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;
 }
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org