Removed dodgy regex
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 22 Nov 2003 06:55:07 +0000 (06:55 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 22 Nov 2003 06:55:07 +0000 (06:55 +0000)
includes/DatabaseFunctions.php

index db24e25..e6bc40b 100644 (file)
@@ -207,7 +207,7 @@ function wfGeneralizeSQL( $sql )
 {
        # This could be done faster with some arrays and a single preg_replace,
        # but this show more clearly what's going on. Which may be a good thing.
-       $sql = preg_replace ( "/'([^\\\\']|\\\\.)*'|\"([^\\\\\"]|\\\\.)*\"/", "'X'", $sql);
+       $sql = preg_replace( "/'.*?[^\\\\]'/", "'X'", $sql );
        $sql = preg_replace ( "/-?\d+/" , "N", $sql);
        $sql = preg_replace ( "/\s+/", " ", $sql);
        return $sql;