From 89d429dbeeca331ddbec487dfe121ccd37efee48 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 2 Aug 2024 09:12:48 +0200 Subject: [PATCH] Fix two new phpstan issues --- plugins/password/drivers/domainfactory.php | 3 +-- program/lib/Roundcube/rcube_mime.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/password/drivers/domainfactory.php b/plugins/password/drivers/domainfactory.php index 9bc2a6f27..ae32de6f3 100644 --- a/plugins/password/drivers/domainfactory.php +++ b/plugins/password/drivers/domainfactory.php @@ -70,8 +70,7 @@ class rcube_domainfactory_password // show error message(s) if possible if (strpos($response, '
') !== false) { - preg_match_all('#
(.*?)
#s', $response, $errors); - if (isset($errors[1])) { + if (preg_match_all('#
(.*?)
#s', $response, $errors)) { $error_message = ''; foreach ($errors[1] as $error) { $error_message .= trim(rcube_charset::convert($error, 'ISO-8859-15')) . ' '; diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php index 21416efa7..3640dd942 100644 --- a/program/lib/Roundcube/rcube_mime.php +++ b/program/lib/Roundcube/rcube_mime.php @@ -204,8 +204,7 @@ class rcube_mime $tmp[] = $text; if (!empty($matches[$idx + 1])) { $next_match = $matches[$idx + 1]; - if (count($next_match) >= 2 - && $next_match[0][1] == $start + if ($next_match[0][1] == $start && $next_match[1][0] == $charset && $next_match[2][0] == $encoding ) {