From f48908f41daeafdd105d56ef486644eb478604fd Mon Sep 17 00:00:00 2001 From: halftrainedharry Date: Wed, 18 Sep 2024 12:58:20 +0200 Subject: [PATCH 1/2] Fix error handler for PHP 8 --- core/src/Revolution/Error/modErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/Revolution/Error/modErrorHandler.php b/core/src/Revolution/Error/modErrorHandler.php index c388adca02f..c8fcaa6a7bc 100644 --- a/core/src/Revolution/Error/modErrorHandler.php +++ b/core/src/Revolution/Error/modErrorHandler.php @@ -58,7 +58,7 @@ function __construct(modX &$modx, array $stack = []) */ public function handleError($errno, $errstr, $errfile = null, $errline = null, $errcontext = null) { - if (error_reporting() == 0) { + if (error_reporting() == 0 || ($errno === E_WARNING && (error_reporting() & E_WARNING) === 0 )) { return false; } From 78b845e47353a67918d6996349205f086e30ac25 Mon Sep 17 00:00:00 2001 From: halftrainedharry Date: Wed, 18 Sep 2024 21:42:39 +0200 Subject: [PATCH 2/2] implement a more generalized solution --- core/src/Revolution/Error/modErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/Revolution/Error/modErrorHandler.php b/core/src/Revolution/Error/modErrorHandler.php index c8fcaa6a7bc..368bd48645a 100644 --- a/core/src/Revolution/Error/modErrorHandler.php +++ b/core/src/Revolution/Error/modErrorHandler.php @@ -58,7 +58,7 @@ function __construct(modX &$modx, array $stack = []) */ public function handleError($errno, $errstr, $errfile = null, $errline = null, $errcontext = null) { - if (error_reporting() == 0 || ($errno === E_WARNING && (error_reporting() & E_WARNING) === 0 )) { + if (error_reporting() == 0 || !(error_reporting() & $errno)) { return false; }