Always ignopre undefined indexes notices

This commit is contained in:
fbsanchez 2021-07-22 11:29:01 +02:00
parent 1cbda1ce15
commit f83fddb4ff
1 changed files with 5 additions and 3 deletions

View File

@ -1340,7 +1340,7 @@ class Client
error_reporting(E_ALL ^ E_NOTICE);
set_error_handler(
function ($errno, $errstr) {
if (preg_match('/Undefined index/', $errstr) > 1) {
if (preg_match('/Undefined index/i', $errstr) > 0) {
return;
}
@ -1351,7 +1351,9 @@ class Client
register_shutdown_function(
function () {
$error = error_get_last();
if (null !== $error) {
if (null !== $error
&& preg_match('/Undefined index/i', $error['message']) !== 1
) {
echo __('Failed to analyze package: %s', $error['message']);
}
}
@ -1433,7 +1435,7 @@ class Client
error_reporting(E_ALL ^ E_NOTICE);
set_error_handler(
function ($errno, $errstr) {
if (preg_match('/Undefined index/', $errstr) > 1) {
if (preg_match('/Undefined index/i', $errstr) > 0) {
return;
}