diff --git a/ChangeLog b/ChangeLog index 80c7d8d6b3..7cc7485638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,6 +44,9 @@ phpMyAdmin - ChangeLog 4.9.3 (not yet released) - issue #15570 Fix page contents go underneath of floating menubar in some cases - issue #15591 Fix php notice 'Undefined index: foreign_keys_data' on relations view when the user has column access +- issue #15592 Fix php warning "error_reporting() has been disabled for security reasons" +- issue #15434 Fix middle click on table sort column name shows a blank page +- issue Fix php notice "Undefined index table_create_time" when setting displayed columns on results of a view 4.9.2 (2019-11-21) - issue #14184 Change the cookie name from phpMyAdmin to phpMyAdmin_https for HTTPS, fixes many "Failed to set session cookie" errors diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php index 2bdcedc046..bbceae8dcc 100644 --- a/libraries/classes/Config.php +++ b/libraries/classes/Config.php @@ -779,13 +779,19 @@ class Config $this->error_config_default_file = true; return false; } - $old_error_reporting = error_reporting(0); + $canUseErrorReporting = function_exists('error_reporting'); + $oldErrorReporting = null; + if ($canUseErrorReporting) { + $oldErrorReporting = error_reporting(0); + } ob_start(); $GLOBALS['pma_config_loading'] = true; $eval_result = include $this->default_source; $GLOBALS['pma_config_loading'] = false; ob_end_clean(); - error_reporting($old_error_reporting); + if ($canUseErrorReporting) { + error_reporting($oldErrorReporting); + } if ($eval_result === false) { $this->error_config_default_file = true; @@ -831,13 +837,19 @@ class Config * Parses the configuration file, we throw away any errors or * output. */ - $old_error_reporting = error_reporting(0); + $canUseErrorReporting = function_exists('error_reporting'); + $oldErrorReporting = null; + if ($canUseErrorReporting) { + $oldErrorReporting = error_reporting(0); + } ob_start(); $GLOBALS['pma_config_loading'] = true; $eval_result = include $this->getSource(); $GLOBALS['pma_config_loading'] = false; ob_end_clean(); - error_reporting($old_error_reporting); + if ($canUseErrorReporting) { + error_reporting($oldErrorReporting); + } if ($eval_result === false) { $this->error_config_file = true; diff --git a/libraries/classes/Controllers/Table/RelationController.php b/libraries/classes/Controllers/Table/RelationController.php index 07633d30d6..af26681fa9 100644 --- a/libraries/classes/Controllers/Table/RelationController.php +++ b/libraries/classes/Controllers/Table/RelationController.php @@ -264,8 +264,7 @@ class RelationController extends AbstractController $this->options_array, $this->table, is_array($this->existrel_foreign) && array_key_exists('foreign_keys_data', $this->existrel_foreign) - ? $this->existrel_foreign['foreign_keys_data'] - : null + ? $this->existrel_foreign['foreign_keys_data'] : [], ); $this->response->addHTML($html); } diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php index b4cd15aebc..98b62ca17e 100644 --- a/libraries/classes/Display/Results.php +++ b/libraries/classes/Display/Results.php @@ -1717,6 +1717,7 @@ class Results 'db' => $this->__get('db'), 'table' => $this->__get('table'), 'sql_query' => $single_sorted_sql_query, + 'sql_signature' => Core::signSqlQuery($single_sorted_sql_query), 'session_max_rows' => $session_max_rows, 'is_browse_distinct' => $this->__get('is_browse_distinct'), ]; @@ -1725,6 +1726,7 @@ class Results 'db' => $this->__get('db'), 'table' => $this->__get('table'), 'sql_query' => $multi_sorted_sql_query, + 'sql_signature' => Core::signSqlQuery($multi_sorted_sql_query), 'session_max_rows' => $session_max_rows, 'is_browse_distinct' => $this->__get('is_browse_distinct'), ]; diff --git a/libraries/classes/ErrorHandler.php b/libraries/classes/ErrorHandler.php index efefd1e494..f5cf1247ff 100644 --- a/libraries/classes/ErrorHandler.php +++ b/libraries/classes/ErrorHandler.php @@ -52,7 +52,9 @@ class ErrorHandler if (! defined('TESTSUITE')) { set_error_handler([$this, 'handleError']); } - $this->error_reporting = error_reporting(); + if (function_exists('error_reporting')) { + $this->error_reporting = error_reporting(); + } } /** @@ -163,16 +165,23 @@ class ErrorHandler string $errfile, int $errline ): void { - /** - * Check if Error Control Operator (@) was used, but still show - * user errors even in this case. - */ - if (error_reporting() == 0 && - $this->error_reporting != 0 && - ($errno & (E_USER_WARNING | E_USER_ERROR | E_USER_NOTICE)) == 0 - ) { - return; + if (function_exists('error_reporting')) { + /** + * Check if Error Control Operator (@) was used, but still show + * user errors even in this case. + */ + if (error_reporting() == 0 && + $this->error_reporting != 0 && + ($errno & (E_USER_WARNING | E_USER_ERROR | E_USER_NOTICE)) == 0 + ) { + return; + } + } else { + if (($errno & (E_USER_WARNING | E_USER_ERROR | E_USER_NOTICE)) == 0) { + return; + } } + $this->addError($errstr, $errno, $errfile, $errline, true); } diff --git a/libraries/classes/Sql.php b/libraries/classes/Sql.php index e56df246b5..fb4b07f3f1 100644 --- a/libraries/classes/Sql.php +++ b/libraries/classes/Sql.php @@ -643,7 +643,7 @@ class Sql $retval = $pmatable->setUiProp( $property_to_set, $property_value, - $_POST['table_create_time'] + isset($_POST['table_create_time']) ? $_POST['table_create_time'] : null ); if (gettype($retval) != 'boolean') { $response = Response::getInstance(); diff --git a/show_config_errors.php b/show_config_errors.php index 68e6826f43..46d854af9b 100644 --- a/show_config_errors.php +++ b/show_config_errors.php @@ -34,7 +34,10 @@ header('Content-Type: text/html; charset=utf-8'); require ROOT_PATH . 'libraries/vendor_config.php'; -error_reporting(E_ALL); +if (function_exists('error_reporting')) { + error_reporting(E_ALL); +} + /** * Read config file. */