janinedog: (Default)
Janine ([personal profile] janinedog) wrote in [site community profile] changelog2009-04-06 06:24 pm

[dw-free] string::replace doesn't work with anything not [a-zA-Z0-9]

[commit: http://hg.dwscoalition.org/dw-free/rev/4ece28120040]

http://bugs.dwscoalition.org/show_bug.cgi?id=683

Make the S2 string replace function work with special characters.

Patch by [personal profile] exor674.

Files modified:
  • cgi-bin/LJ/S2.pm
--------------------------------------------------------------------------------
diff -r 59a8859e0514 -r 4ece28120040 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Mon Apr 06 18:09:02 2009 +0000
+++ b/cgi-bin/LJ/S2.pm	Mon Apr 06 18:24:24 2009 +0000
@@ -4178,7 +4178,7 @@ sub string__replace
 {
     use utf8;
     my ($ctx, $this, $find, $replace) = @_;
-    $this =~ s/\Q$find\E/\Q$replace\E/g;
+    $this =~ s/\Q$find\E/$replace/g;
     return $this;
 }
 
--------------------------------------------------------------------------------