From 1f4b6ec0ac86574978ca2ae3d2c61c16260847a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 5 Apr 2017 10:12:24 +0200 Subject: [PATCH] Ensure we have only integers in colum visibility and ordering data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes PHP error in case of invalid table preferences. Fixes #13152 Signed-off-by: Michal Čihař --- ChangeLog | 1 + libraries/Table.php | 2 +- libraries/sql.lib.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3c5b7dde0..f3b24efb7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ phpMyAdmin - ChangeLog - issue #13146 Do not include devel dependencies in the release - issue #13144 Do not show New as a database in database dropdown - issue #13130 Fixed handling of errors in AJAX requests +- issue #13152 Fixed PHP error in case of invalid table preferences 4.7.0 (2017-03-28) - patch #12233 [Display] Improve message when renaming database to same name diff --git a/libraries/Table.php b/libraries/Table.php index 5149fdb221..5cebd5a383 100644 --- a/libraries/Table.php +++ b/libraries/Table.php @@ -1749,7 +1749,7 @@ class Table // check if the table has not been modified if ($this->getStatusInfo('Create_time') == $this->uiprefs['CREATE_TIME'] ) { - return $this->uiprefs[$property]; + return array_map('intval', $this->uiprefs[$property]); } // remove the property, since the table has been modified diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index cb45ad02dc..fbbcc66fe5 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -712,7 +712,7 @@ function PMA_hasNoRightsToDropDatabase($analyzed_sql_results, */ function PMA_setColumnProperty($pmatable, $request_index) { - $property_value = explode(',', $_REQUEST[$request_index]); + $property_value = array_map('intval', explode(',', $_REQUEST[$request_index])); switch($request_index) { case 'col_order': $property_to_set = Table::PROP_COLUMN_ORDER;