ListUnsubscribe - Ensure URL is always absolute
authorTim Otten <totten@civicrm.org>
Thu, 18 Jan 2024 05:51:18 +0000 (21:51 -0800)
committerTim Otten <totten@civicrm.org>
Wed, 24 Jan 2024 08:47:36 +0000 (00:47 -0800)
When delivering via unit-test or cron job, the URL came out absolute.

But when using web UI to "Send test", the URL was relative.

It should be absolute.

CRM/Mailing/Service/ListUnsubscribe.php

index 32d9c5764302b6d4071537310bf152a30c269b75..6b5fedaf03c362f35e32450509443d1f6a1ba7f7 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Mailing_Service_ListUnsubscribe extends \Civi\Core\Service\AutoService
       $listUnsubscribe[] = $params['List-Unsubscribe'];
     }
     if (array_intersect(['http', 'oneclick'], $methods)) {
-      $listUnsubscribe[] = '<' . Civi::url('civicrm/mailing/unsubscribe')->addQuery([
+      $listUnsubscribe[] = '<' . Civi::url('civicrm/mailing/unsubscribe', 'a')->addQuery([
         'reset' => 1,
         'jid' => $m[1],
         'qid' => $m[2],