From: Richard van Oosterhout Date: Thu, 15 Feb 2018 13:43:43 +0000 (+0100) Subject: CRM-21768_NOFOLLOW_links_in_public_online_view_of_mailings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=43e0759fe5baa0a2e34da730769844cd062cce38;p=civicrm-core.git CRM-21768_NOFOLLOW_links_in_public_online_view_of_mailings --- diff --git a/CRM/Mailing/BAO/TrackableURL.php b/CRM/Mailing/BAO/TrackableURL.php index 6d563f3ee2..b1e40d7009 100644 --- a/CRM/Mailing/BAO/TrackableURL.php +++ b/CRM/Mailing/BAO/TrackableURL.php @@ -97,7 +97,7 @@ class CRM_Mailing_BAO_TrackableURL extends CRM_Mailing_DAO_TrackableURL { $returnUrl = "{$urlCache[$mailing_id . $url]}&qid={$queue_id}"; if ($hrefExists) { - $returnUrl = "href='{$returnUrl}'"; + $returnUrl = "href='{$returnUrl}' rel='nofollow'"; } return $returnUrl; diff --git a/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php b/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php index 81d60b46d6..fa841ab14d 100644 --- a/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php +++ b/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php @@ -207,7 +207,7 @@ abstract class CRM_Mailing_BaseMailingSystemTest extends CiviUnitTestCase { $this->assertRegExp( ";" . // body_html - "

You can go to Google" . + "

You can go to Google" . " or opt out.

\n" . // Default footer "Sample Footer for HTML formatted content" .