From f8edf0376b3c7d8dfb00c00b6baf633a9bc16741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 22 Feb 2017 08:48:38 +0100 Subject: [PATCH 1/3] This really should not happen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The configuration defaults are applied globally. In case this does happen again, it should be properly investigated. Signed-off-by: Michal Čihař --- libraries/ErrorHandler.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libraries/ErrorHandler.php b/libraries/ErrorHandler.php index 0a3e33a06d..50bee00c3a 100644 --- a/libraries/ErrorHandler.php +++ b/libraries/ErrorHandler.php @@ -326,10 +326,6 @@ class ErrorHandler */ public function getDispErrors() { - // Not sure why but seen in https://reports.phpmyadmin.net/ - if (empty($GLOBALS['cfg']['SendErrorReports'])) { - $GLOBALS['cfg']['SendErrorReports'] = 'ask'; - } $retval = ''; // display errors if SendErrorReports is set to 'ask'. if ($GLOBALS['cfg']['SendErrorReports'] != 'never') { From 1a4c5e4e8f55d65f593d5065856b554541665dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 22 Feb 2017 08:51:16 +0100 Subject: [PATCH 2/3] Remove commented out code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/ErrorHandler.php | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/ErrorHandler.php b/libraries/ErrorHandler.php index 50bee00c3a..b5549954c5 100644 --- a/libraries/ErrorHandler.php +++ b/libraries/ErrorHandler.php @@ -407,7 +407,6 @@ class ErrorHandler $this->errors[$hash] = $error; } } - //$this->errors = array_merge($_SESSION['errors'], $this->errors); // delete stored errors $_SESSION['errors'] = array(); From 999a58609f2c33675da1ce48aed025fc72c07085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 22 Feb 2017 08:52:03 +0100 Subject: [PATCH 3/3] Error is always instance of Error class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We rely on this in other places in ErrorHandler as well, there is no reason for this place to be different. Signed-off-by: Michal Čihař --- libraries/ErrorHandler.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/ErrorHandler.php b/libraries/ErrorHandler.php index b5549954c5..3eaba73c44 100644 --- a/libraries/ErrorHandler.php +++ b/libraries/ErrorHandler.php @@ -330,12 +330,8 @@ class ErrorHandler // display errors if SendErrorReports is set to 'ask'. if ($GLOBALS['cfg']['SendErrorReports'] != 'never') { foreach ($this->getErrors() as $error) { - if ($error instanceof Error) { - if (! $error->isDisplayed()) { - $retval .= $error->getDisplay(); - } - } else { - $retval .= var_export($error, true); + if (! $error->isDisplayed()) { + $retval .= $error->getDisplay(); } } } else {