From 6d67dc258baaf6b667b028a228e1f3dc793aaceb Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 16 Sep 2015 08:09:08 -0400 Subject: [PATCH] Fixes #11486 Server variable edition in ANSI_QUOTES sql_mode: losing current value Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/server_variables.lib.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 665a72c344..8277a46fb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ phpMyAdmin - ChangeLog - issue Invalid argument supplied for foreach() - issue array_key_exists() expects parameter 2 to be array - issue #11480 Notice Undefined index: drop_database +- issue #11486 Server variable edition in ANSI_QUOTES sql_mode: losing current value 4.5.0.0 (not yet released) + rfe Pagination for GIS visualization diff --git a/libraries/server_variables.lib.php b/libraries/server_variables.lib.php index ec9164313b..807aef8efe 100644 --- a/libraries/server_variables.lib.php +++ b/libraries/server_variables.lib.php @@ -25,9 +25,11 @@ function PMA_getAjaxReturnForGetVal($variable_doc_links) // Send with correct charset header('Content-Type: text/html; charset=UTF-8'); + // Do not use double quotes inside the query to avoid a problem + // when server is running in ANSI_QUOTES sql_mode $varValue = $GLOBALS['dbi']->fetchSingleRow( - 'SHOW GLOBAL VARIABLES WHERE Variable_name="' - . PMA_Util::sqlAddSlashes($_REQUEST['varName']) . '";', + 'SHOW GLOBAL VARIABLES WHERE Variable_name=\'' + . PMA_Util::sqlAddSlashes($_REQUEST['varName']) . '\';', 'NUM' ); if (isset($variable_doc_links[$_REQUEST['varName']][3])