From db679781398373cfc7844a7b909ae1dafb7d975b Mon Sep 17 00:00:00 2001 From: Michael McAndrew Date: Tue, 22 May 2018 16:28:19 +0100 Subject: [PATCH] only add a closing quote if it is not already present --- CRM/Mailing/BAO/Mailing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 9e7c1ea53a..09983f45bf 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1342,10 +1342,10 @@ ORDER BY civicrm_email.is_bulkmail DESC } // add trailing quote since we've gobbled it up in a previous regex // function getPatterns, line 431 - if (preg_match('/^href[ ]*=[ ]*\'/', $url)) { + if (preg_match("/^href[ ]*=[ ]*'.*[^']$/", $url)) { $url .= "'"; } - elseif (preg_match('/^href[ ]*=[ ]*\"/', $url)) { + elseif (preg_match('/^href[ ]*=[ ]*".*[^"]$/', $url)) { $url .= '"'; } $data = $url; -- 2.25.1