From c9ed5f56bff36165ec85d74ddcf550f726ebd1a0 Mon Sep 17 00:00:00 2001 From: Lars SG Date: Wed, 21 Apr 2021 08:32:57 -0600 Subject: [PATCH] Do not add tracking to internal anchor URLs --- CRM/Mailing/BAO/TrackableURL.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.25.1