From e18937d5d2c17ca09c831fcda49b03446b19e8ce Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 25 Jul 2004 21:20:10 +0000 Subject: [PATCH] better use default values in the fonction --- libraries/common.lib.php | 2 +- main.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 0b3c850ee..f93d54400 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -685,7 +685,7 @@ if ($is_minimum_common == FALSE) { * * @access private */ - function PMA_charsetIntroducerCollate($original_string, $charset_introducer, $collation) + function PMA_charsetIntroducerCollate($original_string, $charset_introducer='_latin1', $collation='latin1_swedish_ci') { $result = ''; if (PMA_MYSQL_INT_VERSION >= 40100) { diff --git a/main.php b/main.php index 526859eb8..7ea7c88d7 100644 --- a/main.php +++ b/main.php @@ -183,7 +183,7 @@ if ($server > 0) { $is_superuser = PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user', $userlink, PMA_DBI_QUERY_STORE); if ($dbh) { // TODO: do we need to check the charset and collation of mysql.user? - $local_query = 'SELECT Create_priv, Reload_priv FROM mysql.user WHERE User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user),'_latin1', 'latin1_swedish_ci') . ';'; + $local_query = 'SELECT Create_priv, Reload_priv FROM mysql.user WHERE User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user)) . ';'; $rs_usr = PMA_DBI_try_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE); if ($rs_usr) { while ($result_usr = PMA_DBI_fetch_assoc($rs_usr)) { @@ -202,7 +202,7 @@ if ($server > 0) { // the first inexistant db name that we find, in most cases it's probably // the one he just dropped :) if (!$is_create_priv) { - $local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Create_priv = ' . PMA_charsetIntroducerCollate('Y','_latin1','latin1_swedish_ci') . ' AND User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user),'_latin1','latin1_swedish_ci') . ';'; + $local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Create_priv = ' . PMA_charsetIntroducerCollate('Y') . ' AND User = ' . PMA_charsetIntroducerCollate(PMA_sqlAddslashes($mysql_cur_user)) . ';'; $rs_usr = PMA_DBI_try_query($local_query, $dbh, PMA_DBI_QUERY_STORE); if ($rs_usr) { $re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards