From: Jakub Vrana Date: Mon, 24 Mar 2025 06:25:17 +0000 (+0100) Subject: Mute the same error in PHP 5 X-Git-Tag: v5.1.0~22 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=9fd9a1fc8dfff4583333463e17a7d75748f18e66;p=adminer.git Mute the same error in PHP 5 --- diff --git a/adminer/include/errors.inc.php b/adminer/include/errors.inc.php index d9cc99fd..ac7c54c0 100644 --- a/adminer/include/errors.inc.php +++ b/adminer/include/errors.inc.php @@ -3,5 +3,8 @@ namespace Adminer; error_reporting(24575); // all but E_DEPRECATED (overriding mysqli methods without types is deprecated) set_error_handler(function ($errno, $errstr) { - return !!preg_match('~^(Trying to access array offset on( value of type)? null|Undefined array key)~', $errstr); + // "offset on null" mutes $_GET["fields"][0] if there's no ?fields[]= (62017e3 is a wrong fix for this) + // "Undefined array key" mutes $_GET["q"] if there's no ?q= + // "Undefined offset" and "Undefined index" are older messages for the same thing + return !!preg_match('~^(Trying to access array offset on( value of type)? null|Undefined (array key|offset|index))~', $errstr); }, E_WARNING | E_NOTICE); // warning since PHP 8.0