From: Federico Leva Date: Thu, 28 Nov 2013 11:47:19 +0000 (+0100) Subject: Add mediawiki.org to default $wgNoFollowDomainExceptions X-Git-Tag: 1.31.0-rc.0~17834^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=bfb75b7f343db795b49d4c4670fea97cfa064d4e;p=lhc%2Fweb%2Fwiklou.git Add mediawiki.org to default $wgNoFollowDomainExceptions It doesn't make sense to apply nofollow to links included by default, for instance on Special:Version. It kind of defeats the purpose of those links and makes MediaWiki and all MediaWiki wikis less connected and more sparse, harder to find. Make some assumptions of SideBarTest explicit so that it tests what is should. Change-Id: I5e7ad67c0037b099236cf7e1b73ae669ebcec0f1 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e23aea481f..3102384dd1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3811,13 +3811,16 @@ $wgNoFollowNsExceptions = array(); * (or any subdomains) will not be set to rel="nofollow" regardless of the * value of $wgNoFollowLinks. For instance: * - * $wgNoFollowDomainExceptions = array( 'en.wikipedia.org', 'wiktionary.org' ); + * $wgNoFollowDomainExceptions = array( 'en.wikipedia.org', 'wiktionary.org', + * 'mediawiki.org' ); * * This would add rel="nofollow" to links to de.wikipedia.org, but not * en.wikipedia.org, wiktionary.org, en.wiktionary.org, us.en.wikipedia.org, * etc. + * + * Defaults to mediawiki.org for the links included in the software by default. */ -$wgNoFollowDomainExceptions = array(); +$wgNoFollowDomainExceptions = array( 'mediawiki.org' ); /** * Allow DISPLAYTITLE to change title display diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php index fc06ee43b8..7d33a59202 100644 --- a/tests/phpunit/skins/SideBarTest.php +++ b/tests/phpunit/skins/SideBarTest.php @@ -90,6 +90,11 @@ class SideBarTest extends MediaWikiLangTestCase { * @covers SkinTemplate::addToSidebarPlain */ public function testExternalUrlsRequireADescription() { + $this->setMwGlobals( array( + 'wgNoFollowLinks' => true, + 'wgNoFollowDomainExceptions' => array(), + 'wgNoFollowNsExceptions' => array(), + ) ); $this->assertSidebar( array( 'Title' => array( # ** http://www.mediawiki.org/| Home @@ -162,6 +167,8 @@ class SideBarTest extends MediaWikiLangTestCase { public function testTestAttributesAssertionHelper() { $this->setMwGlobals( array( 'wgNoFollowLinks' => true, + 'wgNoFollowDomainExceptions' => array(), + 'wgNoFollowNsExceptions' => array(), 'wgExternalLinkTarget' => false, ) ); $attribs = $this->getAttribs();