From 6ddfd8b7260cdf89fe27dabcb1f126d80efed833 Mon Sep 17 00:00:00 2001 From: JediKev <kevin@enhancesoft.com> Date: Mon, 23 Apr 2018 15:15:14 -0500 Subject: [PATCH] issue: Drop Gmail "ltr" Attributes This addresses an issue where the New Activity Notice Template was not keeping the CSS styling for the %{message} variable. This was due to Gmail adding `<div dir="ltr">` tags around some text in the body causing the CSS styling to break. This adds RegEx to the formatter so we can remove the `<div dir="ltr">` tags from the email body before the New Activity Notice Template is sent preserving the CSS styling. --- include/class.format.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/class.format.php b/include/class.format.php index 7d7d7d922..735aa40d1 100644 --- a/include/class.format.php +++ b/include/class.format.php @@ -306,8 +306,9 @@ class Format { ':<!DOCTYPE[^>]+>:', # <!DOCTYPE ... > ':<\?[^>]+>:', # <?xml version="1.0" ... > ':<html[^>]+:i', # drop html attributes + ':<div dir=(3D)?"ltr">(.*?)<\/div>(.*):is', # drop Gmail "ltr" attributes ), - array('', '', '', '', '<html'), + array('', '', '', '', '<html', '$2 $3'), $html); // HtmLawed specific config only -- GitLab