From 0267fa9af7e18aa6449726f748e672cdac192d12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 28 Jun 2020 15:50:05 +0200 Subject: [PATCH] Fix PHP 8 compatibility for WCF::handleError() Quoting from the UPGRADING manual (https://github.com/php/php-src/blob/php-8.0.0alpha1/UPGRADING): > The @ operator will no longer silence fatal errors (E_ERROR, E_CORE_ERROR, > E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR, E_PARSE). Error handlers > that expect error_reporting to be 0 when @ is used, should be adjusted to > use a mask check instead: --- wcfsetup/install/files/lib/system/WCF.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 1bcc9cde96..5f465eeab3 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -336,7 +336,7 @@ class WCF { */ public static final function handleError($severity, $message, $file, $line) { // this is necessary for the shut-up operator - if (error_reporting() == 0) return; + if (!(error_reporting() & $severity)) return; throw new ErrorException($message, 0, $severity, $file, $line); } -- 2.20.1