Commit 977eb97b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5477 Destroy session in case of fatal error to avoid lock out

Showing with 3 additions and 1 deletion
+3 -1
...@@ -258,8 +258,8 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) ...@@ -258,8 +258,8 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
$error_collector_mailto .= $mailto_trace; $error_collector_mailto .= $mailto_trace;
/* Flush in case of fatal errors */ /* Flush in case of fatal errors */
set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT);
if (preg_match('/^fatal/i', $errstr) || (PHP_ERROR_FATAL == 'TRUE')) { if (preg_match('/^fatal/i', $errstr) || (PHP_ERROR_FATAL == 'TRUE')) {
session::destroy();
if (PHP_ERROR_FATAL == 'TRUE') { if (PHP_ERROR_FATAL == 'TRUE') {
$error_collector = str_replace('display: none;', '', $error_collector); $error_collector = str_replace('display: none;', '', $error_collector);
} }
...@@ -267,6 +267,8 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) ...@@ -267,6 +267,8 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
flush(); flush();
exit; exit;
} }
set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT);
} }
/*! /*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment