From faea634699c4ecef0251b61ab036afb6f7fafc9c Mon Sep 17 00:00:00 2001
From: JediKev <kevin@enhancesoft.com>
Date: Fri, 23 Mar 2018 09:32:37 -0500
Subject: [PATCH] issue: Outlook _MailEndCompose

This addresses an issue where Outlook adds weird (and seemingly random)
_MailEndCompose tags to the email body which turns unwanted content into
links. This adds the _MailEndCompose tag to Format::sanitize() so it
will be removed from the email body.
---
 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 6058142d8..ecd44bb16 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
+                  ':<(a|span) (name|style)="(mso-bookmark\:)?_MailEndCompose">(.+)?<\/(a|span)>:', # Drop _MailEndCompose
             ),
-            array('', '', '', '', '<html'),
+            array('', '', '', '', '<html', '$4'),
             $html);
 
         // HtmLawed specific config only
-- 
GitLab