Add mediawiki.org to default $wgNoFollowDomainExceptions
authorFederico Leva <federicoleva@tiscali.it>
Thu, 28 Nov 2013 11:47:19 +0000 (12:47 +0100)
committerFederico Leva <federicoleva@tiscali.it>
Mon, 2 Dec 2013 18:22:55 +0000 (19:22 +0100)
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

includes/DefaultSettings.php
tests/phpunit/skins/SideBarTest.php

index e23aea4..3102384 100644 (file)
@@ -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
index fc06ee4..7d33a59 100644 (file)
@@ -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();