[Jifty-commit] r3197 - jifty/trunk/lib/Jifty/View/Mason

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat May 5 21:51:06 EDT 2007


Author: ruz
Date: Sat May  5 21:51:06 2007
New Revision: 3197

Modified:
   jifty/trunk/lib/Jifty/View/Mason/Handler.pm

Log:
escape_utf8
* don't use bytes just escape things doesn't matter if it's
  flagged string or not, perl must do the right thing.
* don't localize ref, use it directly, afaik smaller
  memory footprint

Modified: jifty/trunk/lib/Jifty/View/Mason/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Mason/Handler.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Mason/Handler.pm	Sat May  5 21:51:06 2007
@@ -161,18 +161,14 @@
 
 sub escape_utf8 {
     my $ref = shift;
-    my $val = $$ref;
-    use bytes;
     no warnings 'uninitialized';
-    $val =~ s/&/&/g;
-    $val =~ s/</&lt;/g;
-    $val =~ s/>/&gt;/g;
-    $val =~ s/\(/&#40;/g;
-    $val =~ s/\)/&#41;/g;
-    $val =~ s/"/&#34;/g;
-    $val =~ s/'/&#39;/g;
-    $$ref = $val;
-    Encode::_utf8_on($$ref);
+    $$ref =~ s/&/&#38;/g;
+    $$ref =~ s/</&lt;/g;
+    $$ref =~ s/>/&gt;/g;
+    $$ref =~ s/\(/&#40;/g;
+    $$ref =~ s/\)/&#41;/g;
+    $$ref =~ s/"/&#34;/g;
+    $$ref =~ s/'/&#39;/g;
 }
 
 


More information about the Jifty-commit mailing list