Browse Source

Fix PHP8 warnings

pull/8132/head
Aleksander Machniak 4 years ago
parent
commit
157f969417
  1. 2
      plugins/enigma/lib/enigma_signature.php
  2. 4
      program/include/rcmail_sendmail.php

2
plugins/enigma/lib/enigma_signature.php

@ -55,7 +55,7 @@ class enigma_signature
while (array_pop($level) !== null) {
$parent = join('.', $level);
if ($parts[$parent] && $parts[$parent]->mimetype == 'message/rfc822') {
if (!empty($parts[$parent]) && $parts[$parent]->mimetype == 'message/rfc822') {
$from = $parts[$parent]->headers['from'];
$charset = $parts[$parent]->charset;
break;

4
program/include/rcmail_sendmail.php

@ -678,14 +678,13 @@ class rcmail_sendmail
$hash = md5($data) . '@' . $domain;
$mime_type = $matches[2][$idx][0];
$name = $list[$hash];
if (empty($mime_type)) {
$mime_type = rcube_mime::image_content_type($data);
}
// add the image to the MIME message
if (!$name) {
if (empty($list[$hash])) {
$ext = preg_replace('#^[^/]+/#', '', $mime_type);
$name = substr($hash, 0, 8) . '.' . $ext;
$list[$hash] = $name;
@ -693,6 +692,7 @@ class rcmail_sendmail
$message->addHTMLImage($data, $mime_type, $name, false, $hash);
}
$name = $list[$hash];
$body = substr_replace($body, $name, $m[1] + $offset, strlen($m[0]));
$offset += strlen($name) - strlen($m[0]);
}

Loading…
Cancel
Save