Do not add tracking to internal anchor URLs
authorLars SG <lars@wildsight.ca>
Wed, 21 Apr 2021 14:32:57 +0000 (08:32 -0600)
committerLars SG <lars@wildsight.ca>
Wed, 21 Apr 2021 14:32:57 +0000 (08:32 -0600)
CRM/Mailing/BAO/TrackableURL.php

index ea6d032db4d534b3308400fb853763c5c4bce7eb..7026e718f7932095da216f3f6b1e6e9a0ed8e7a1 100644 (file)
@@ -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;