Commit 9662fdde by Qiang Xue

Merge pull request #3328 from armab/patch-1

BaseMailer: strip <style> content from TextBody fix
parents d43f1c1b 31313996
......@@ -186,6 +186,10 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont
if (isset($text)) {
$message->setTextBody($text);
} elseif (isset($html)) {
if (preg_match('|<body[^>]*>(.*?)</body>|is', $html, $match)) {
$html = $match[1];
}
$html = preg_replace('|<style[^>]*>(.*?)</style>|is', '', $html);
$message->setTextBody(strip_tags($html));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment