[Rt-commit] [svn] r1812 - in rt/branches/PLATANO-EXPERIMENTAL-CSS: . lib/RT/Interface lib/RT/Interface/Web

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Thu Nov 11 03:16:25 EST 2004


Author: jesse
Date: Thu Nov 11 03:16:24 2004
New Revision: 1812

Modified:
   rt/branches/PLATANO-EXPERIMENTAL-CSS/   (props changed)
   rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web.pm
   rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web/Handler.pm
Log:
 r9074 at tinbook:  jesse | 2004-11-11T02:54:58.891576Z
  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/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web.pm	Thu Nov 11 03:16:24 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/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web/Handler.pm
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web/Handler.pm	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Interface/Web/Handler.pm	Thu Nov 11 03:16:24 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