[Rt-commit] r14659 - in rtfm/trunk: .

falcone at bestpractical.com falcone at bestpractical.com
Wed Jul 30 16:05:11 EDT 2008


Author: falcone
Date: Wed Jul 30 16:05:07 2008
New Revision: 14659

Modified:
   rtfm/trunk/   (props changed)
   rtfm/trunk/lib/RT/FM/Article_Overlay.pm

Log:
 r36391 at ketch:  falcone | 2008-07-30 10:08:39 -0400
 * check arguments in both Linking directions


Modified: rtfm/trunk/lib/RT/FM/Article_Overlay.pm
==============================================================================
--- rtfm/trunk/lib/RT/FM/Article_Overlay.pm	(original)
+++ rtfm/trunk/lib/RT/FM/Article_Overlay.pm	Wed Jul 30 16:05:07 2008
@@ -386,13 +386,13 @@
     # Disallow parsing of plain numbers in article links.  If they are
     # allowed, they default to being tickets instead of articles, which
     # is counterintuitive.
-    if ($args{'Target'} =~ /^\d+$/) {
+    if ($args{'Target'} =~ /^\d+$/ || $args{'Base'} =~ /^\d+$/) {
         return ( 0, $self->loc("Cannot add link to plain number") );
     }
 
     # Check that we're actually getting a valid URI
     my $uri_obj = RT::URI->new( $self->CurrentUser );
-    $uri_obj->FromURI( $args{'Target'} );
+    $uri_obj->FromURI( $args{'Target'}||$args{'Base'} );
     unless ( $uri_obj->Resolver && $uri_obj->Scheme ) {
         my $msg = $self->loc( "Couldn't resolve '[_1]' into a Link.", $args{'Target'} );
         $RT::Logger->warning( $msg );


More information about the Rt-commit mailing list