1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-28 07:41:55 +03:00

Do not delete session on fatal error

I see no reason why this should be done, the fatal error is used
in following cases:

* Very early when there is no session (eg. missing extension)
* Invalid value for parameters
* Invalid invocation like too big request

In neither case session removal will do any good.

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař
2016-12-13 09:55:28 +01:00
parent 15f63f3d96
commit 73499a5e56
2 changed files with 2 additions and 13 deletions

View File

@@ -2157,7 +2157,7 @@ class Util
}
}
if ($found_error) {
PMA_fatalError($error_message, null, false);
PMA_fatalError($error_message);
}
} // end function

View File

@@ -206,13 +206,10 @@ function PMA_securePath($path)
*
* @param string $error_message the error message or named error message
* @param string|array $message_args arguments applied to $error_message
* @param boolean $delete_session whether to delete session cookie
*
* @return void
*/
function PMA_fatalError(
$error_message, $message_args = null, $delete_session = true
) {
function PMA_fatalError($error_message, $message_args = null) {
/* Use format string if applicable */
if (is_string($message_args)) {
$error_message = sprintf($error_message, $message_args);
@@ -249,14 +246,6 @@ function PMA_fatalError(
$lang = isset($GLOBALS['lang']) ? $GLOBALS['lang'] : 'en';
$dir = isset($GLOBALS['text_dir']) ? $GLOBALS['text_dir'] : 'ltr';
// on fatal errors it cannot hurt to always delete the current session
if ($delete_session
&& isset($GLOBALS['session_name'])
&& isset($_COOKIE[$GLOBALS['session_name']])
) {
$GLOBALS['PMA_Config']->removeCookie($GLOBALS['session_name']);
}
// Displays the error message
include './libraries/error.inc.php';
}