From 3cd2cdb3d5ccd468a6afd3902bf3a2ffbba12219 Mon Sep 17 00:00:00 2001 From: "Mr. E23" Date: Wed, 19 Nov 2003 01:19:47 +0000 Subject: [PATCH] Fixed bug in wfGeneralizeSQL() that caused strings in some queries to remain --- includes/DatabaseFunctions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.20.1