Open scr34m opened 1 year ago
Another suppressed error causing this message vendor/javanile/php-imap2/src/Roundcube/Charset.php:228 Undefined offset: 2
here https://github.com/javanile/php-imap2/blob/main/src/Roundcube/Charset.php#L228
else if (preg_match('/U[A-Z][A-Z](7|8|16|32)(BE|LE)*/', $str, $m)) {
If $str
is simply UTF-8
then this generates a warning.
The error suppression doesn't work, if you have a custom error handler, at this line
while (@list($name, $value) = $this->tokenizeResponse($line, 2)) {
so it generates NOTICE when tokenizeResponse returns an empty array, https://github.com/javanile/php-imap2/blob/main/src/Roundcube/ImapClient.php#L2497.The generated notice message is the following
/vendor/javanile/php-imap2/src/Roundcube/ImapClient.php:2497 Undefined offset: 0
and/vendor/javanile/php-imap2/src/Roundcube/ImapClient.php:2496 Undefined offset: 1
To test simply use
$line
withUID 69)\n
so it will be parsed asthen remaining content is only
)\n
which is resulting an empty arrayphp array(0) { }
A better solution would be to check return value instead of error suppression.