From 1dfeb3f87d7ef2c461b62c12c84dad5d17b35a96 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 22 Dec 2009 18:05:31 +0000 Subject: [PATCH] patch #2918831 [export] Missing backquotes on reserved words --- ChangeLog | 2 ++ libraries/common.lib.php | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01ccf78d2..dac2826e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA thanks to Greg Roach - fisharebest - patch #2915168 [import] Incorrect parsing of DELIMITER keyword, thanks to Greg Roach - fisharebest +- patch #2918831 [export] Missing backquotes on reserved words, + thanks to Virsacer - virsacer 3.2.4.0 (2009-12-02) - bug [engines] Innodb_buffer_pool_pages_latched no longer returned in status diff --git a/libraries/common.lib.php b/libraries/common.lib.php index fd138f581..3233dbb93 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -890,16 +890,20 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count = */ function PMA_backquote($a_name, $do_it = true) { - if (! $do_it) { + if (is_array($a_name)) { + foreach ($a_name as &$data) { + $data = PMA_backquote($data, $do_it); + } return $a_name; } - if (is_array($a_name)) { - $result = array(); - foreach ($a_name as $key => $val) { - $result[$key] = PMA_backquote($val); - } - return $result; + if (! $do_it) { + global $PMA_SQPdata_forbidden_word; + global $PMA_SQPdata_forbidden_word_cnt; + + if(! PMA_STR_binarySearchInArr(strtoupper($a_name), $PMA_SQPdata_forbidden_word, $PMA_SQPdata_forbidden_word_cnt)) { + return $a_name; + } } // '0' is also empty for php :-(