diff options
author | ivan <ivan> | 2007-08-02 19:56:20 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-08-02 19:56:20 +0000 |
commit | ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 (patch) | |
tree | a2ea500cf510739908761a6bfbd14e990131f2cc /rt/lib/RT/URI | |
parent | a513c0bef534d05f03c1242831b6f3be19b97dae (diff) |
import rt 3.6.4
Diffstat (limited to 'rt/lib/RT/URI')
-rw-r--r-- | rt/lib/RT/URI/base.pm | 10 | ||||
-rw-r--r-- | rt/lib/RT/URI/fsck_com_rt.pm | 23 | ||||
-rw-r--r-- | rt/lib/RT/URI/t.pm | 47 |
3 files changed, 63 insertions, 17 deletions
diff --git a/rt/lib/RT/URI/base.pm b/rt/lib/RT/URI/base.pm index 56bfef33a..1b8506087 100644 --- a/rt/lib/RT/URI/base.pm +++ b/rt/lib/RT/URI/base.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC # <jesse@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/copyleft/gpl.html. # # # CONTRIBUTION SUBMISSION POLICY: @@ -81,12 +83,8 @@ sub ParseObject { my $self = shift; my $obj = shift; $self->{'uri'} = "unknown-object:".ref($obj); - - } - - sub ParseURI { my $self = shift; my $uri = shift; diff --git a/rt/lib/RT/URI/fsck_com_rt.pm b/rt/lib/RT/URI/fsck_com_rt.pm index ba98b1df4..f3e4d211f 100644 --- a/rt/lib/RT/URI/fsck_com_rt.pm +++ b/rt/lib/RT/URI/fsck_com_rt.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC # <jesse@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/copyleft/gpl.html. # # # CONTRIBUTION SUBMISSION POLICY: @@ -128,7 +130,7 @@ is($uri->LocalURIPrefix. "/ticket/1" , $uri->URIForObject($ticket)); sub URIForObject { my $self = shift; my $obj = shift; - return ($self->LocalURIPrefix."/".$self->ObjectType($obj)."/". $obj->Id); + return ($self->LocalURIPrefix ."/". $self->ObjectType($obj) ."/". $obj->Id); } @@ -143,12 +145,12 @@ sub ParseURI { my $self = shift; my $uri = shift; - if ( $uri =~ /^(\d+)$/ ) { + if ( $uri =~ /^\d+$/ ) { my $ticket = RT::Ticket->new( $self->CurrentUser ); - $ticket->Load($uri); + $ticket->Load( $uri ); $self->{'uri'} = $ticket->URI; $self->{'object'} = $ticket; - return($ticket->id); + return ($ticket->id); } else { $self->{'uri'} = $uri; @@ -156,9 +158,8 @@ sub ParseURI { #If it's a local URI, load the ticket object and return its URI if ( $self->IsLocal ) { - my $local_uri_prefix = $self->LocalURIPrefix; - if ( $self->{'uri'} =~ /^$local_uri_prefix\/(.*?)\/(\d+)$/i ) { + if ( $self->{'uri'} =~ /^\Q$local_uri_prefix\E\/(.*?)\/(\d+)$/i ) { my $type = $1; my $id = $2; @@ -192,9 +193,9 @@ Returns undef otherwise. sub IsLocal { my $self = shift; - my $local_uri_prefix = $self->LocalURIPrefix; - if ($self->{'uri'} =~ /^$local_uri_prefix/i) { - return 1; + my $local_uri_prefix = $self->LocalURIPrefix; + if ( $self->{'uri'} =~ /^\Q$local_uri_prefix/i ) { + return 1; } else { return undef; diff --git a/rt/lib/RT/URI/t.pm b/rt/lib/RT/URI/t.pm index 2f95b2d3e..efd13a482 100644 --- a/rt/lib/RT/URI/t.pm +++ b/rt/lib/RT/URI/t.pm @@ -1,3 +1,50 @@ +# BEGIN BPS TAGGED BLOCK {{{ +# +# COPYRIGHT: +# +# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +# <jesse@bestpractical.com> +# +# (Except where explicitly superseded by other copyright notices) +# +# +# LICENSE: +# +# This work is made available to you under the terms of Version 2 of +# the GNU General Public License. A copy of that license should have +# been provided with this software, but in any event can be snarfed +# from www.gnu.org. +# +# This work is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/copyleft/gpl.html. +# +# +# CONTRIBUTION SUBMISSION POLICY: +# +# (The following paragraph is not intended to limit the rights granted +# to you to modify and distribute this software under the terms of +# the GNU General Public License and is only of importance to you if +# you choose to contribute your changes and enhancements to the +# community by submitting them to Best Practical Solutions, LLC.) +# +# By intentionally submitting any modifications, corrections or +# derivatives to this work, or any other work intended for use with +# Request Tracker, to Best Practical Solutions, LLC, you confirm that +# you are the copyright holder for those contributions and you grant +# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +# royalty-free, perpetual, license to use, copy, create derivative +# works based on those contributions, and sublicense and distribute +# those contributions and any derivatives thereof. +# +# END BPS TAGGED BLOCK }}} # BEGIN LICENSE BLOCK # # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> |