From f99a7c046336aaa05d27a2932c7a94d64b09aff8 Mon Sep 17 00:00:00 2001 From: Robin Johnson Date: Tue, 6 Aug 2002 17:15:39 +0000 Subject: [PATCH] Fixes for bugs in Loic's changes --- libraries/common.lib.php3 | 2 +- libraries/sqlvalidator.php3 | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 93904d2a9..f8c1af86c 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -1129,7 +1129,7 @@ if (typeof(document.getElementById) != 'undefined' if (!empty($GLOBALS['show_as_php'])) { $query_base = '$sql = "' . $query_base; } else if (!empty($GLOBALS['validatequery'])) { - $query_base = validateSQL($query_base); + $query_base = PMA_validateSQL($query_base); } else { $parsed_sql = PMA_SQP_parse($query_base); $query_base = PMA_formatSql($parsed_sql); diff --git a/libraries/sqlvalidator.php3 b/libraries/sqlvalidator.php3 index 9856ffef6..6407bce34 100644 --- a/libraries/sqlvalidator.php3 +++ b/libraries/sqlvalidator.php3 @@ -37,8 +37,10 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) { // We need the PEAR libraries, so do a minimum version check first // I'm not sure if PEAR was available before this point // For now we actually use a configuration flag - if ($cfg['SQLValidator']['use'] == TRUE && !defined(PMA_SQL_VALIDATOR_CLASS_INCLUDED)) { - include('./sqlvalidator.class.php3'); + if ($cfg['SQLValidator']['use'] == TRUE) { + // We cannot check && !defined(PMA_SQL_VALIDATOR_CLASS_INCLUDED)) + // as it will produce a nasty warning message + include('./libraries/sqlvalidator.class.php3'); } // if ($cfg['SQLValidator']['use'] == TRUE) @@ -83,9 +85,7 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) { // Do service validation $str = $srv->validationString($sql); - } - } - else { + } else { // The service is not available so note that properly $str = $GLOBALS['strValidatorDisabled']; } // end if... else...