Fixed a bug with privileges with escaped wilcards in database names

This commit is contained in:
Loïc Chapeaux
2002-04-13 06:57:31 +00:00
parent c007632e3a
commit 1a4817fb85
2 changed files with 5 additions and 2 deletions

View File

@@ -7,6 +7,9 @@ $Source$
2002-04-13 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2002-04-13 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* lang/korean.inc.php3: fixed some inconcistencies. * lang/korean.inc.php3: fixed some inconcistencies.
* main.php3, lines 200-201: fixed a bug with privileges with escaped
wilcards in database names. Thanks to
Mike Eheler <meheler @ users.sourceforge.net>.
2002-04-12 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2002-04-12 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/display_tbl.lib.php3, lines 957-991: expended cosmetic changes * libraries/display_tbl.lib.php3, lines 957-991: expended cosmetic changes

View File

@@ -197,8 +197,8 @@ if ($server > 0) {
while ($row = mysql_fetch_array($rs_usr)) { while ($row = mysql_fetch_array($rs_usr)) {
if (ereg($re . '%|_', $row['Db']) if (ereg($re . '%|_', $row['Db'])
|| !mysql_select_db($row['Db'], $userlink) && @mysql_errno() != 1044) { || !mysql_select_db($row['Db'], $userlink) && @mysql_errno() != 1044) {
$row['Db'] = ereg_replace($re . '%', '\\1...', ereg_replace($re . '_', '\\1?', $row['Db'])); $db_to_create = ereg_replace($re . '%', '\\1...', ereg_replace($re . '_', '\\1?', $row['Db']));
$db_to_create = $row['Db']; $db_to_create = ereg_replace('\\\(%|_)', '\\1', $db_to_create);
$is_create_priv = TRUE; $is_create_priv = TRUE;
break; break;
} // end if } // end if