X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FURI%2Ffsck_com_rt.pm;h=f3e4d211fedd2afd924d2f48e396670d3f93206d;hp=ba98b1df4658a6f273cfbfe9bf8791ab534535b0;hb=ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4;hpb=a513c0bef534d05f03c1242831b6f3be19b97dae 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 # # # (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;