1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
From: William Desportes <williamdes@wdes.fr>
Date: Sat, 18 Mar 2023 16:23:28 +0100
Subject: Fix PHP 8 error reporting detection
Origin: vendor
Forwarded: no
Ref: https://github.com/phpmyadmin/phpmyadmin/issues/16729#issuecomment-797664051
Ref: https://php.watch/versions/8.0/fatal-error-suppression
Ref: https://www.php.net/manual/fr/function.error-reporting.php#125674
Ref: https://www.php.net/manual/en/migration80.incompatible.php
---
lib/functions.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/functions.php b/lib/functions.php
index 5746aa5..367385c 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -130,12 +130,13 @@ function app_error_handler($errno,$errstr,$file,$lineno) {
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
/**
- * error_reporting will be 0 if the error context occurred
- * within a function call with '@' preprended (ie, @ldap_bind() );
+ * error_reporting will be only the non-ignorable error number bits
+ * if the error context occurred within a function call with '@'
+ * preprended (ie, @ldap_bind() );
* So, don't report errors if the caller has specifically
* disabled them with '@'
*/
- if (ini_get('error_reporting') == 0 || error_reporting() == 0)
+ if (!(ini_get('error_reporting') & error_reporting() & $errno))
return;
$file = basename($file);
|