From b0d95e5c7418fb4b14ca7ddf8e1b22dccb1038e1 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 8 May 2014 18:09:29 -0500
Subject: [PATCH] oops: Ensure cid does not corrupt the regex

---
 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 1981575e0..8ba433c8f 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -1048,7 +1048,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 = preg_replace('/src=("|\'|\b)(?:cid:)?'.$a['cid'].'\1/i',
+                    $body = preg_replace('/src=("|\'|\b)(?:cid:)?'.preg_quote($a['cid']).'\1/i',
                         'src="cid:'.$a['key'].'"', $body);
                 }
             }
-- 
GitLab