better use default values in the fonction
This commit is contained in:
@@ -685,7 +685,7 @@ if ($is_minimum_common == FALSE) {
|
|||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function PMA_charsetIntroducerCollate($original_string, $charset_introducer, $collation)
|
function PMA_charsetIntroducerCollate($original_string, $charset_introducer='_latin1', $collation='latin1_swedish_ci')
|
||||||
{
|
{
|
||||||
$result = '';
|
$result = '';
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
||||||
|
4
main.php
4
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);
|
$is_superuser = PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user', $userlink, PMA_DBI_QUERY_STORE);
|
||||||
if ($dbh) {
|
if ($dbh) {
|
||||||
// TODO: do we need to check the charset and collation of mysql.user?
|
// 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);
|
$rs_usr = PMA_DBI_try_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
|
||||||
if ($rs_usr) {
|
if ($rs_usr) {
|
||||||
while ($result_usr = PMA_DBI_fetch_assoc($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 first inexistant db name that we find, in most cases it's probably
|
||||||
// the one he just dropped :)
|
// the one he just dropped :)
|
||||||
if (!$is_create_priv) {
|
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);
|
$rs_usr = PMA_DBI_try_query($local_query, $dbh, PMA_DBI_QUERY_STORE);
|
||||||
if ($rs_usr) {
|
if ($rs_usr) {
|
||||||
$re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards
|
$re0 = '(^|(\\\\\\\\)+|[^\])'; // non-escaped wildcards
|
||||||
|
Reference in New Issue
Block a user