summaryrefslogtreecommitdiff
path: root/rt/lib/RT/URI
diff options
context:
space:
mode:
authorivan <ivan>2007-08-02 19:56:20 +0000
committerivan <ivan>2007-08-02 19:56:20 +0000
commit9509e5bfb7f9331303153cac24d7bfecbe2ea9f1 (patch)
tree7ff1dce47668339f41f0ddea0e31e85d7788d4df /rt/lib/RT/URI
parentb052ee7b17d87c95f650857989b33ecffc9089c5 (diff)
parentef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 (diff)
This commit was generated by cvs2svn to compensate for changes in r5562,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/RT/URI')
-rw-r--r--rt/lib/RT/URI/base.pm10
-rw-r--r--rt/lib/RT/URI/fsck_com_rt.pm23
-rw-r--r--rt/lib/RT/URI/t.pm47
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>