From 754a3946d4912ef0e9c927d96b5a9a77c39528a8 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 19 Mar 2014 09:06:29 -0500
Subject: [PATCH] email: Fix inline images sent in old HTML markup

---
 include/class.thread.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/class.thread.php b/include/class.thread.php
index 0722c80d2..b11eac143 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -1036,7 +1036,7 @@ Class ThreadEntry {
                 // content-id will be discarded, only the unique hash-code
                 // will be available to retrieve the image later
                 if ($a['cid'] && $a['key']) {
-                    $body = str_replace('src="cid:'.$a['cid'].'"',
+                    $body = preg_replace('/src=("|\'|\b)cid:'.$a['cid'].'\1/i',
                         'src="cid:'.$a['key'].'"', $body);
                 }
             }
-- 
GitLab