bug 460475

This commit is contained in:
Marc Delisle
2001-09-16 00:32:52 +00:00
parent b1cae4386e
commit 041a81a8e1
2 changed files with 7 additions and 1 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-09-15 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php3, bug #460475: user can be blank in
mysql.db (anonymous user), as stated in MySQL doc.
2001-09-15 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* tbl_change.php3, lines 351-352: fixed bug #461623 (wrong maxlength in
table_change.php).

View File

@@ -401,7 +401,9 @@ if (!defined('__LIB_COMMON__')){
// This maintenance is to fix code to work correctly for
// regular expressions.
if ($row['Select_priv'] != 'Y') {
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND User = \'' . $PHP_AUTH_USER . '\'';
// User can be blank (anonymous user)
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . $PHP_AUTH_USER . '\'
OR User = \'\') ';
$rs = mysql_query($local_query) or mysql_die('', $local_query, FALSE, FALSE);
if (@mysql_numrows($rs) <= 0) {
$local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . $PHP_AUTH_USER . '\'';