From: Lars SG Date: Wed, 21 Apr 2021 14:32:57 +0000 (-0600) Subject: Do not add tracking to internal anchor URLs X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c9ed5f56bff36165ec85d74ddcf550f726ebd1a0;p=civicrm-core.git Do not add tracking to internal anchor URLs --- diff --git a/CRM/Mailing/BAO/TrackableURL.php b/CRM/Mailing/BAO/TrackableURL.php index ea6d032db4..7026e718f7 100644 --- a/CRM/Mailing/BAO/TrackableURL.php +++ b/CRM/Mailing/BAO/TrackableURL.php @@ -54,10 +54,11 @@ class CRM_Mailing_BAO_TrackableURL extends CRM_Mailing_DAO_TrackableURL { } // hack for basic CRM-1014 and CRM-1151 and CRM-3492 compliance: - // let's not replace possible image URLs and CiviMail ones + // let's not replace possible image URLs, CiviMail URLs or internal anchor URLs if (preg_match('/\.(png|jpg|jpeg|gif|css)[\'"]?$/i', $url) or substr_count($url, 'civicrm/extern/') or substr_count($url, 'civicrm/mailing/') + or ($url[0] === '#') ) { // let's not cache these, so they don't get &qid= appended to them return $url;