[Rt-commit] [svn] r1665 - in rt/branches/3.3-TESTING: . lib/RT/Interface lib/RT/Interface/Web

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Wed Oct 20 01:46:55 EDT 2004


Author: jesse
Date: Wed Oct 20 01:46:54 2004
New Revision: 1665

Modified:
   rt/branches/3.3-TESTING/   (props changed)
   rt/branches/3.3-TESTING/lib/RT/Interface/Web.pm
   rt/branches/3.3-TESTING/lib/RT/Interface/Web/Handler.pm
Log:
 r6050 at tinbook:  jesse | 2004-10-20T05:33:26.027966Z
 RT-Ticket: 5729
 RT-Status: resolved
 RT-Action: correspond
 
 Patch fixes issue with multibyte characters escaping in URLs. --Ruslan
 
 


Modified: rt/branches/3.3-TESTING/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/Interface/Web.pm	Wed Oct 20 01:46:54 2004
@@ -94,6 +94,24 @@
 
 # }}}
 
+# {{{ EscapeURI
+
+=head2 EscapeURI SCALARREF
+
+Escapes URI component according to RFC2396
+
+=cut
+
+use Encode qw();
+sub EscapeURI {
+    my $ref = shift;
+    $$ref = Encode::encode_utf8( $$ref );
+    $$ref =~ s/([^a-zA-Z0-9_.!~*'()-])/uc sprintf("%%%02X", ord($1))/eg;
+    Encode::_utf8_on( $$ref );
+}
+
+# }}}
+
 # {{{ WebCanonicalizeInfo
 
 =head2 WebCanonicalizeInfo();

Modified: rt/branches/3.3-TESTING/lib/RT/Interface/Web/Handler.pm
==============================================================================
--- rt/branches/3.3-TESTING/lib/RT/Interface/Web/Handler.pm	(original)
+++ rt/branches/3.3-TESTING/lib/RT/Interface/Web/Handler.pm	Wed Oct 20 01:46:54 2004
@@ -171,6 +171,7 @@
     );
   
     $handler->interp->set_escape( h => \&RT::Interface::Web::EscapeUTF8 );
+    $handler->interp->set_escape( u => \&RT::Interface::Web::EscapeURI  );
     return($handler);
 }
 


More information about the Rt-commit mailing list