Navigation Menu

Skip to content

Commit

Permalink
Fixing an issue with embedded images
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
gergoe committed Nov 21, 2014
1 parent de5c035 commit 157547a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions class.phpmailer.php
Expand Up @@ -2910,11 +2910,7 @@ public function msgHTML($message, $basedir = '', $advanced = false)
}
$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)
Expand Down

0 comments on commit 157547a

Please sign in to comment.