[Jifty-commit] r4657 - in jifty/trunk: lib/Jifty/View/Mason

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Dec 8 23:42:34 EST 2007


Author: jesse
Date: Sat Dec  8 23:42:32 2007
New Revision: 4657

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/View/Mason/Handler.pm

Log:
 r72834 at pinglin:  jesse | 2007-12-08 22:38:02 -0500
 * Terrifyingly, the added /s causes escape_html (2% of hiveminder's runtime) to benchmark 200% faster.


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 Dec  8 23:42:32 2007
@@ -127,13 +127,13 @@
 sub escape_utf8 {
     my $ref = shift;
     no warnings 'uninitialized';
-    $$ref =~ s/&/&/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;
+    $$ref =~ s/&/&#38;/gs;
+    $$ref =~ s/</&lt;/gs;
+    $$ref =~ s/>/&gt;/gs;
+    $$ref =~ s/\(/&#40;/gs;
+    $$ref =~ s/\)/&#41;/gs;
+    $$ref =~ s/"/&#34;/gs;
+    $$ref =~ s/'/&#39;/gs;
 }
 
 =head2 escape_uri SCALARREF


More information about the Jifty-commit mailing list