User:Lysander/Noreferrer hack

From BoyWiki
Revision as of 19:57, 13 April 2015 by Lysander (talk | contribs) (Created page with "This is a proposed hack to make it so that external links will have [http://www.w3schools.com/tags/att_a_rel.asp rel=noreferrer] applied to them. This function is found in <co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is a proposed hack to make it so that external links will have rel=noreferrer applied to them. This function is found in Parser.php:

public static function getExternalLinkRel( $url = false, $title = null ) { global $wgNoFollowLinks, $wgNoFollowNsExceptions, $wgNoFollowDomainExceptions; $ns = $title ? $title->getNamespace() : false; if ( $wgNoFollowLinks && !in_array( $ns, $wgNoFollowNsExceptions ) && !wfMatchesDomainList( $url, $wgNoFollowDomainExceptions ) ) { return 'nofollow'; } return null; }

It should be changed to:

public static function getExternalLinkRel( $url = false, $title = null ) { global $wgNoFollowLinks, $wgNoFollowNsExceptions, $wgNoFollowDomainExceptions; $ns = $title ? $title->getNamespace() : false; if ( $wgNoFollowLinks && !in_array( $ns, $wgNoFollowNsExceptions ) && !wfMatchesDomainList( $url, $wgNoFollowDomainExceptions ) ) { return 'nofollow noreferrer'; } return 'noreferrer'; }