From 84011aa736bb9a029b47dad5b6404f68f9674aef Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Mon, 22 Jul 2013 14:48:16 +1200 Subject: [PATCH] FIX Only suppress fatal errors --- core/startup/ErrorControlChain.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/startup/ErrorControlChain.php b/core/startup/ErrorControlChain.php index aa2b825fa..1861f4b88 100644 --- a/core/startup/ErrorControlChain.php +++ b/core/startup/ErrorControlChain.php @@ -18,6 +18,8 @@ * It will likely be heavily refactored before the release of 3.2 */ class ErrorControlChain { + public static $fatal_errors = null; // Initialised after class definition + protected $error = false; protected $steps = array(); @@ -67,8 +69,12 @@ class ErrorControlChain { } public function handleError($errno, $errstr) { - if ((error_reporting() & $errno) == $errno && $this->suppression) throw new Exception('Generic Error'); - else return false; + if ((error_reporting() & self::$fatal_errors & $errno) != 0 && $this->suppression) { + throw new Exception('Generic Error'); + } + else { + return false; + } } protected function lastErrorWasFatal() { @@ -117,3 +123,6 @@ class ErrorControlChain { } } } + +ErrorControlChain::$fatal_errors = E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR; +if (defined('E_RECOVERABLE_ERROR')) ErrorControlChain::$fatal_errors |= E_RECOVERABLE_ERROR;