From a90a46877ee0ba36a2e956cc6292911c88488ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 17 Oct 2001 20:49:52 +0000 Subject: [PATCH] fixed bug #472209 (Login password bug if magic_quotes_gpc is set) --- ChangeLog | 6 ++++-- libraries/common.lib.php3 | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb6a99cd9..55a437f84 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12,8 +12,10 @@ $Source$ * Documentation.html, lines 766-770: added a link to the official MySQL documentation for the "socket error" problems. * index.php3, line 53; lang/*: out-sourced the "no frame" sentence. - * libraries/common.lib.php3: improved compatibility with the old phpMyAdmin - configuration file. + * libraries/common.lib.php3: + - improved compatibility with the old phpMyAdmin configuration file; + - lines 427-434: fixed bug #472209 (Login password bug if + magic_quotes_gpc is set. * tbl_properties.php3, line 1243: added a param. to enforce reloading of the left frame after a flush if $cfgShowTooltip is set to 1. * tbl_change.php3: fixed some inconcistancies if an update is required but diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 822ff8e18..6237e4d6b 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -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 '