Fix two new phpstan issues

This commit is contained in:
Aleksander Machniak
2024-08-02 09:12:48 +02:00
parent c706575a0b
commit 89d429dbee
2 changed files with 2 additions and 4 deletions

View File

@@ -70,8 +70,7 @@ class rcube_domainfactory_password
// show error message(s) if possible
if (strpos($response, '<div class="d-msg-text">') !== false) {
preg_match_all('#<div class="d-msg-text">(.*?)</div>#s', $response, $errors);
if (isset($errors[1])) {
if (preg_match_all('#<div class="d-msg-text">(.*?)</div>#s', $response, $errors)) {
$error_message = '';
foreach ($errors[1] as $error) {
$error_message .= trim(rcube_charset::convert($error, 'ISO-8859-15')) . ' ';

View File

@@ -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
) {