0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 10:02:14 +02:00

Make background attribute pattern match more precise, see #1877

This commit is contained in:
Marcus Bointon 2019-10-30 18:21:19 +01:00
parent 4e9a7614ce
commit a7c75c6328

View File

@ -3975,7 +3975,7 @@ class PHPMailer
*/
public function msgHTML($message, $basedir = '', $advanced = false)
{
preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
preg_match_all('/\s(src|background)=["\'](.*)["\']/Ui', $message, $images);
if (array_key_exists(2, $images)) {
if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) {
// Ensure $basedir has a trailing /