bug #3442004 [interface] DB suggestion not correct for user with underscore

This commit is contained in:
Marc Delisle
2011-11-26 06:17:08 -05:00
parent 9c278d020c
commit dddcddbf38
2 changed files with 6 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog
3.4.9.0 (not yet released) 3.4.9.0 (not yet released)
- bug #3442028 [edit] Inline editing enum fields with null shows no dropdown - bug #3442028 [edit] Inline editing enum fields with null shows no dropdown
- bug #3442004 [interface] DB suggestion not correct for user with underscore
3.4.8.0 (not yet released) 3.4.8.0 (not yet released)
- bug #3425230 [interface] enum data split at space char (more space to edit) - bug #3425230 [interface] enum data split at space char (more space to edit)

View File

@@ -128,8 +128,11 @@ function PMA_analyseShowGrant()
&& substr(PMA_DBI_getError(), 1, 4) != 1044) && substr(PMA_DBI_getError(), 1, 4) != 1044)
) { ) {
if ($GLOBALS['cfg']['SuggestDBName']) { if ($GLOBALS['cfg']['SuggestDBName']) {
$GLOBALS['db_to_create'] = preg_replace('/' . $re0 . '_/', '\\1?', $show_grants_dbname); /**
$GLOBALS['db_to_create'] = preg_replace('/' . $re0 . '%/', '\\1...', $GLOBALS['db_to_create']); * Do not handle the underscore wildcard
* (this case must be rare anyway)
*/
$GLOBALS['db_to_create'] = preg_replace('/' . $re0 . '%/', '\\1...', $show_grants_dbname);
$GLOBALS['db_to_create'] = preg_replace('/' . $re1 . '(%|_)/', '\\1\\3', $GLOBALS['db_to_create']); $GLOBALS['db_to_create'] = preg_replace('/' . $re1 . '(%|_)/', '\\1\\3', $GLOBALS['db_to_create']);
} }
$GLOBALS['is_create_db_priv'] = true; $GLOBALS['is_create_db_priv'] = true;