0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 18:03:04 +02:00

Fixing an issue with embedded images

Fixed the issue with html parsing when there was an embedded base64
encoded image in the source - which resulted in regexp errors (too long
regexp).
This commit is contained in:
gergoe 2014-11-21 13:47:30 +01:00
parent de5c035380
commit 157547a51f

View File

@ -2910,11 +2910,7 @@ class PHPMailer
}
$cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
if ($this->addStringEmbeddedImage($data, $cid, '', 'base64', $match[1])) {
$message = preg_replace(
'/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui',
$images[1][$imgindex] . '="cid:' . $cid . '"',
$message
);
$message = str_replace($images[0][$imgindex], $images[1][$imgindex] . '="cid:' . $cid . '"', $message);
}
} elseif (!preg_match('#^[A-z]+://#', $url)) {
// Do not change urls for absolute images (thanks to corvuscorax)