Better fix against bug #594947.

This commit is contained in:
Alexander M. Turek
2002-08-26 07:04:07 +00:00
parent c2b48044f5
commit e942c1ce70
91 changed files with 167 additions and 61 deletions

View File

@@ -62,31 +62,36 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
$str = '';
if ($cfg['SQLValidator']['use']
&& !(isset($GLOBALS['sqlvalidator_error'])
&& $GLOBALS['sqlvalidator_error'])) {
// create new class instance
$srv = new PMA_SQLValidator();
if ($cfg['SQLValidator']['use']) {
if (!(isset($GLOBALS['sqlvalidator_error'])
|| !$GLOBALS['sqlvalidator_error'])) {
// create new class instance
$srv = new PMA_SQLValidator();
// Checks for username settings
// The class defaults to anonymous with an empty password
// automatically
if ($cfg['SQLValidator']['username'] != '') {
$srv->setCredentials($cfg['SQLValidator']['username'], $cfg['SQLValidator']['password']);
}
// Identify ourselves to the server properly...
$srv->appendCallingProgram('phpMyAdmin', PMA_VERSION);
// ... and specify what database system we are using
$srv->setTargetDbms('MySQL', PMA_MYSQL_STR_VERSION);
// Log on to service
$srv->start();
// Do service validation
$str = $srv->validationString($sql);
} else {
$str = sprintf($GLOBALS['strValidatorError'], '<a href="./Documentation.html#faqsqlvalidator" target="documentation">', '</a>');
// Checks for username settings
// The class defaults to anonymous with an empty password
// automatically
if ($cfg['SQLValidator']['username'] != '') {
$srv->setCredentials($cfg['SQLValidator']['username'], $cfg['SQLValidator']['password']);
}
// Identify ourselves to the server properly...
$srv->appendCallingProgram('phpMyAdmin', PMA_VERSION);
// ... and specify what database system we are using
$srv->setTargetDbms('MySQL', PMA_MYSQL_STR_VERSION);
// Log on to service
$srv->start();
// Do service validation
$str = $srv->validationString($sql);
} else {
// The service is not available so note that properly
$str = $GLOBALS['strValidatorDisabled'];