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; }