From: Mr. E23 Date: Wed, 19 Nov 2003 01:19:47 +0000 (+0000) Subject: Fixed bug in wfGeneralizeSQL() that caused strings in some queries to remain X-Git-Tag: 1.1.0~137 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=3cd2cdb3d5ccd468a6afd3902bf3a2ffbba12219;p=lhc%2Fweb%2Fwiklou.git Fixed bug in wfGeneralizeSQL() that caused strings in some queries to remain --- diff --git a/includes/DatabaseFunctions.php b/includes/DatabaseFunctions.php index 753d2c8109..b566440dc7 100644 --- a/includes/DatabaseFunctions.php +++ b/includes/DatabaseFunctions.php @@ -200,9 +200,9 @@ function wfInvertTimestamp( $ts ) { 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. + # but this show more clearly what's going on. Which may be a good thing. + $sql = preg_replace ( "/([\'\"])([^\\\\]|\\\\\\\\)*?\\1/", "\\1X\\1'", $sql); $sql = preg_replace ( "/-?\d+/" , "N", $sql); - $sql = preg_replace ( "/([\'\"]).+?[^\\\\]\\1/", "\\1X\\1", $sql); $sql = preg_replace ( "/\s+/", " ", $sql); return $sql; }