From a589b36083f919009d4c7c8ebd969eea3d154c30 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 21 Nov 2003 06:23:54 +0000 Subject: [PATCH] Fixing broken regex in wfGeneralizeSQL --- includes/DatabaseFunctions.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/includes/DatabaseFunctions.php b/includes/DatabaseFunctions.php index 854a3c04b7..db24e258ae 100644 --- a/includes/DatabaseFunctions.php +++ b/includes/DatabaseFunctions.php @@ -95,12 +95,15 @@ function wfEmergencyAbort( $msg = "" ) { function wfQuery( $sql, $db, $fname = "" ) { global $wgLastDatabaseQuery, $wgOut, $wgDebugDumpSql; + global $wgProfiling; - # wfGeneralizeSQL will probably cut down the query to reasonable - # logging size most of the time. The substr is really just a sanity check. - $profName = "wfQuery: " . substr( wfGeneralizeSQL( $sql ), 0, 255 ); - - wfProfileIn( $profName ); + if ( $wgProfiling ) { + # wfGeneralizeSQL will probably cut down the query to reasonable + # logging size most of the time. The substr is really just a sanity check. + $profName = "wfQuery: " . substr( wfGeneralizeSQL( $sql ), 0, 255 ); + + wfProfileIn( $profName ); + } if ( !is_numeric( $db ) ) { # Someone has tried to call this the old way @@ -122,7 +125,10 @@ function wfQuery( $sql, $db, $fname = "" ) $wgOut->databaseError( $fname ); exit; } - wfProfileOut( $profName ); + + if ( $wgProfiling ) { + wfProfileOut( $profName ); + } return $ret; } -- 2.20.1