From 765fab6622c13bca67c6259bf9953fb62221e565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Thu, 12 Jun 2014 16:59:24 +0200 Subject: [PATCH] error handler function reset to cover additional errors --- application/core/ErrorHandler.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/core/ErrorHandler.php b/application/core/ErrorHandler.php index 97d1751e..10e336ae 100644 --- a/application/core/ErrorHandler.php +++ b/application/core/ErrorHandler.php @@ -27,6 +27,7 @@ class ErrorHandler { * Private Properties */ private $maniaControl = null; + private $handlingError = null; /** * Construct Error Handler @@ -73,6 +74,13 @@ class ErrorHandler { return false; } + if (!$this->handlingError) { + // Reset error handler for safety + $this->handlingError = true; + set_error_handler(array(&$this, 'handleError'), -1); + } + + // Build log message $errorTag = $this->getErrorTag($errorNumber); $userError = $this->isUserErrorNumber($errorNumber); $traceSourceClass = null; @@ -92,6 +100,7 @@ class ErrorHandler { $this->maniaControl->log($logMessage); if (!DEV_MODE && !$userError && !$suppressed) { + // Report error $report = array(); $report['Type'] = 'Error'; $report['Message'] = $message; @@ -132,6 +141,9 @@ class ErrorHandler { $this->maniaControl->quit('Quitting ManiaControl after Fatal Error.'); } + // Disable safety state + $this->handlingError = false; + return false; }