Answers.Body: <p>in CiviCRM 4.6.2 you can patch this issue with the following edit:</p>
  
  <pre><code>--- a/a/civicrm-core/CRM/Mailing/BAO/Mailing.php
  +++ b/b/civicrm-core/CRM/Mailing/BAO/Mailing.php
  @@ -1472,7 +1472,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
         if ($this-&gt;url_tracking) {
           $data = CRM_Mailing_BAO_TrackableURL::getTrackerURL($token, $this-&gt;id, $event_queue_id);
           if (!empty($html)) {
  -          $data = htmlentities($data);
  +          $data = htmlentities($data, ENT_NOQUOTES);
           }
         }
         else {
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-18T09:50:55.333Z
Answers.Text: This was fixed in 4.6.4 - via this pull request: https://github.com/civicrm/civicrm-core/pull/5904
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-17T22:33:49.497Z
Answers.LastActivityDate: 2016-11-17T22:33:49.497Z
Answers.UserDisplayName: MetroEast
Answers.Body: <p>I actually found another 4.6.3 site that exhibited identical behavior, so I filed an issue: <a href="https://issues.civicrm.org/jira/browse/CRM-16634" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-16634</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-05T22:45:19.687Z
Answers.LastActivityDate: 2015-06-05T22:45:19.687Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I have a mailing template with this snippet:</p>
  
  <pre><code>Trouble seeing this email? &lt;a href="{mailing.viewUrl}"&gt;Read in your browser&lt;/a&gt;.
  </code></pre>
  
  <p>In previous versions of CiviCRM, the token would render correctly.</p>
  
  <p>In 4.6.2 and 4.6.3, the token renders, but elements of it are HTML-escaped.  More importantly, the quotation marks surrounding the token are HTML-escaped:</p>
  
  <pre><code>Trouble seeing this email? &lt;a href=&amp;quot;http://mysite.org/civicrm/mailing/view?reset=1&amp;amp;id=6&amp;quot;&gt;Read in your browser&lt;/a&gt;.
  </code></pre>
  
  <p>My workaround has been to add a space between the quotation mark and token, which renders correctly:</p>
  
  <pre><code>Trouble seeing this email? &lt;a href=" http://mysite.org/civicrm/mailing/view?reset=1&amp;id=7 "&gt;Read in your browser&lt;/a&gt;.
  </code></pre>
  
  <p>Has anyone else seen this behavior?  I can't send mailings from the demo server, and setting up my dev environment to send e-mails would be a serious pain, so I wanted to check in with the community before reporting it on issues.civicrm.org.  My guess is that some of you have already got e-mails sitting in your inbox that you can test by clicking a link.</p>
  
Tags: <civimail><tokens><issues>
Title: Is there a bug when placing a token inside quotation marks in CiviMail 4.6.2+?
ThreadText: # Is there a bug when placing a token inside quotation marks in CiviMail 4.6.2+?
  
  (Asked by: username_0 on 2015-06-05)
  
  I have a mailing template with this snippet:
  
  ```
  Trouble seeing this email? <a href="{mailing.viewUrl}">Read in your browser</a>.
  
  ```
  
  In previous versions of CiviCRM, the token would render correctly.
  
  In 4.6.2 and 4.6.3, the token renders, but elements of it are HTML-escaped. More importantly, the quotation marks surrounding the token are HTML-escaped:
  
  ```
  Trouble seeing this email? <a href=&quot;http://mysite.org/civicrm/mailing/view?reset=1&amp;id=6&quot;>Read in your browser</a>.
  
  ```
  
  My workaround has been to add a space between the quotation mark and token, which renders correctly:
  
  ```
  Trouble seeing this email? <a href=" http://mysite.org/civicrm/mailing/view?reset=1&id=7 ">Read in your browser</a>.
  
  ```
  
  Has anyone else seen this behavior? I can't send mailings from the demo server, and setting up my dev environment to send e-mails would be a serious pain, so I wanted to check in with the community before reporting it on issues.civicrm.org. My guess is that some of you have already got e-mails sitting in your inbox that you can test by clicking a link.
  
  **Tags:** civimail, tokens, issues
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-11-17. Score: 3
  
  in CiviCRM 4.6.2 you can patch this issue with the following edit:
  
  ```
  --- a/a/civicrm-core/CRM/Mailing/BAO/Mailing.php
  +++ b/b/civicrm-core/CRM/Mailing/BAO/Mailing.php
  @@ -1472,7 +1472,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
         if ($this->url_tracking) {
           $data = CRM_Mailing_BAO_TrackableURL::getTrackerURL($token, $this->id, $event_queue_id);
           if (!empty($html)) {
  -          $data = htmlentities($data);
  +          $data = htmlentities($data, ENT_NOQUOTES);
           }
         }
         else {
  
  ```
  
  > **Comments:**
  > **username_2**: This was fixed in 4.6.4 - via this pull request: https://github.com/civicrm/civicrm-core/pull/5904  
  
  ---
  
  ### Answer by username_0 on 2015-06-05. Score: 2
  
  I actually found another 4.6.3 site that exhibited identical behavior, so I filed an issue: <https://issues.civicrm.org/jira/browse/CRM-16634>
  
  
  ---
  
  