diff --git a/ChangeLog b/ChangeLog index d7c0d661d9..e86ce4b1d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ phpMyAdmin - ChangeLog - issue #12192 Avoid storing full error data in session - issue #12082 Fixed export of ARCHIVE tables with keys - issue #11565 Add session reload for config authentication +- issue #12229 Do not fail on errors stored in session 4.6.1 (2016-05-02) - issue #12120 PMA_Util not found in insert_edit.lib.php diff --git a/libraries/ErrorHandler.php b/libraries/ErrorHandler.php index c3b3770ce5..8bd408d5a1 100644 --- a/libraries/ErrorHandler.php +++ b/libraries/ErrorHandler.php @@ -80,11 +80,15 @@ class ErrorHandler /** * returns array with all errors * + * @param $check bool Whether to check for session errors + * * @return Error[] */ - public function getErrors() + public function getErrors($check=true) { - $this->checkSavedErrors(); + if ($check) { + $this->checkSavedErrors(); + } return $this->errors; } @@ -108,7 +112,7 @@ class ErrorHandler */ public function sliceErrors($count) { - $errors = $this->getErrors(); + $errors = $this->getErrors(false); $this->errors = array_splice($errors, 0, $count); return array_splice($errors, $count); } @@ -385,11 +389,13 @@ class ErrorHandler /** * return count of errors * + * @param $check bool Whether to check for session errors + * * @return integer number of errors occurred */ - public function countErrors() + public function countErrors($check=true) { - return count($this->getErrors()); + return count($this->getErrors($check)); } /** diff --git a/libraries/session.inc.php b/libraries/session.inc.php index fdb9b073da..ffdfdce0f4 100644 --- a/libraries/session.inc.php +++ b/libraries/session.inc.php @@ -99,12 +99,12 @@ $session_name = 'phpMyAdmin'; // on first start of session we check for errors // f.e. session dir cannot be accessed - session file not created -$orig_error_count = $GLOBALS['error_handler']->countErrors(); +$orig_error_count = $GLOBALS['error_handler']->countErrors(false); $session_result = session_start(); if ($session_result !== true - || $orig_error_count != $GLOBALS['error_handler']->countErrors() + || $orig_error_count != $GLOBALS['error_handler']->countErrors(false) ) { setcookie($session_name, '', 1); $errors = $GLOBALS['error_handler']->sliceErrors($orig_error_count);