fixed bug #472209 (Login password bug if magic_quotes_gpc is set)

This commit is contained in:
Loïc Chapeaux
2001-10-17 20:49:52 +00:00
parent 393cd06e7d
commit a90a46877e
2 changed files with 12 additions and 4 deletions

View File

@@ -424,8 +424,14 @@ if (!defined('__LIB_COMMON__')){
@ini_set('track_errors', $bkp_track_err);
}
$PHP_AUTH_USER = str_replace('\'', '\\\'', $PHP_AUTH_USER);
$PHP_AUTH_PW = str_replace('\'', '\\\'', $PHP_AUTH_PW);
if (get_magic_quotes_gpc()) {
$PHP_AUTH_USER = str_replace('\\"', '"', str_replace('\\\\', '\\', $PHP_AUTH_USER));
$PHP_AUTH_PW = str_replace('\\"', '"', str_replace('\\\\', '\\', $PHP_AUTH_PW));
} else {
$PHP_AUTH_USER = str_replace('\'', '\\\'', $PHP_AUTH_USER);
$PHP_AUTH_PW = str_replace('\'', '\\\'', $PHP_AUTH_PW);
}
$auth_query = 'SELECT User, Password, Select_priv '
. 'FROM mysql.user '
. 'WHERE '