From 06282f7b8f4024cb8c4390e91b3a6698375e7c18 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 12 Jun 2014 10:17:18 +1000 Subject: [PATCH] Bug fix - str replacement with forward slash when href="/", value of $link is forward slash symbol. All forward slashes in HTML like

will be replaced with tracking link and layout will be broken. Should search and replace '"/"'. --- code/email/NewsletterEmail.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/email/NewsletterEmail.php b/code/email/NewsletterEmail.php index 9082a741..c287eb73 100644 --- a/code/email/NewsletterEmail.php +++ b/code/email/NewsletterEmail.php @@ -109,7 +109,12 @@ function __construct($newsletter, $recipient, $fakeRecipient=false) { } // replace the link - $replacements[$link] = $tracked->Link(); + if($link == '/'){ + $link = '"/"'; + $replacements[$link] = '"' . $tracked->Link() . '"'; + }else{ + $replacements[$link] = $tracked->Link(); + } // track that this link is still active $current[] = $tracked->ID;