CRM-21768_NOFOLLOW_links_in_public_online_view_of_mailings #12561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Replaces #11673 with test fix
This patch makes sure the trackable url links in the public view of mailings get the nofollow tag so Google will not index urls with a syntax like: https://abc.xyz/sites/all/modules/civicrm/extern/url.php?u=1234&qid=4321
Before
Currently Google (and possibly other search engines) index the trackable urls, so url's like:
![screenshot from 2018-02-15 12-06-33](https://user-images.githubusercontent.com/2195908/36259563-dd64717e-125e-11e8-9734-85bda6638287.png)
https://abc.xyz/sites/all/modules/civicrm/extern/url.php?u=1234&qid=4321
end up in the search index.
After
Trackable urls get the tag rel='NOFOLLOW', which means Google will not follow the links, which could only happen in a situation of a public viewable mailing anyway. The mailing itself is still able to get indexed. Note: this does not 100% prevent Google from indexing, others means like robots.txt are more robust for that. But this patch at least prevents the strange indexed urls for default configurations.
Technical Details
adding rel='NOFOLLOW' to trackable urls to TrackableURL.php does the trick so far.
Comments
(Another option would have been to insert a metatag in the head of CRM/Mailing/Page/View.php)