From 7732acc6737728e6543a39b86b4e84bb84310b5e Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 6 Jan 2020 21:22:00 +0000 Subject: [PATCH] Better HTML email content style containment git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14837 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/mime.php b/functions/mime.php index b17eb5b2..28c37e36 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -2124,7 +2124,9 @@ function sq_fixstyle($body, $pos, $message, $id, $mailbox){ * body {background: blah-blah} * and change it to .bodyclass so we can just assign it to a
*/ - $content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content); + // Let's try out something that catches stuff like: body, p, div { or stuff like: body a { + // $content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content); + $content = preg_replace("/body((?:\s*(?:,| )\s*[a-z0-9_-]+)*\s*\{.*?\})/si", ".bodyclass\\1", $content); global $use_transparent_security_image; if ($use_transparent_security_image) $secremoveimg = '../images/spacer.png'; -- 2.25.1