diff --git a/ChangeLog b/ChangeLog index dfc458fc4..fd664d3cd 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ $Source$ * lang/sort_lang.sh: Fix status output bug '\n' * db_details_importdocsql.php3: Move hardcoded strings to language files * lang/*.php3: Add new strings for docSQL importer + * libraries/sqlvalidator.*.php3: Finish fixing bug #644709 2003-01-15 Alexander M. Turek * lang/lithuanian-*.inc.php3: Updates, thanks to Vilius Zigmantas (viliusz). diff --git a/libraries/sqlvalidator.class.php3 b/libraries/sqlvalidator.class.php3 index 50659afc1..f61642ce5 100644 --- a/libraries/sqlvalidator.class.php3 +++ b/libraries/sqlvalidator.class.php3 @@ -402,6 +402,12 @@ if (!defined('PMA_SQL_VALIDATOR_CLASS_INCLUDED')) { } // end of the "validationString()" function } // end class PMA_SQLValidator + + //add an extra check to ensure that the class was defined without errors + if (!class_exists('PMA_SQLValidator')) { + $GLOBALS['sqlvalidator_error'] = TRUE; + } + } // end else } // $__PMA_SQL_VALIDATOR_CLASS__ diff --git a/libraries/sqlvalidator.lib.php3 b/libraries/sqlvalidator.lib.php3 index 9fd3c243a..9dbcc29b3 100644 --- a/libraries/sqlvalidator.lib.php3 +++ b/libraries/sqlvalidator.lib.php3 @@ -64,8 +64,10 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) { $str = ''; if ($cfg['SQLValidator']['use']) { - if (!(isset($GLOBALS['sqlvalidator_error']) - && !$GLOBALS['sqlvalidator_error'])) { + if (isset($GLOBALS['sqlvalidator_error']) + && $GLOBALS['sqlvalidator_error']) { + $str = sprintf($GLOBALS['strValidatorError'], '', ''); + } else { // create new class instance $srv = new PMA_SQLValidator(); @@ -87,10 +89,6 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) { // Do service validation $str = $srv->validationString($sql); - - } else { - $str = sprintf($GLOBALS['strValidatorError'], '', ''); - } } // end if