SpecialNewpages: Add redirect=no only to links to redirects
authorFomafix <fomafix@googlemail.com>
Wed, 23 Sep 2015 16:34:46 +0000 (16:34 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Wed, 23 Sep 2015 16:34:46 +0000 (16:34 +0000)
Since 2748c4091 all title links have redirect=no. This is requested in T16353.
To satisfy T16353 it should be enough to add this only to links to redirects.

Appending redirect=no to all links has the disadvantage of a duplicate link.

This change adds redirect=no only to links to redirects.

Change-Id: I33da0f1eadc5dfbc46820015622ee1a55acbfe21

includes/specials/SpecialNewpages.php

index 251a8e0..c8d4aa6 100644 (file)
@@ -315,7 +315,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                        array()
                );
 
-               $query = array( 'redirect' => 'no' );
+               $query = $title->isRedirect() ? array( 'redirect' => 'no' ) : array();
 
                // Linker::linkKnown() uses 'known' and 'noclasses' options.
                // This breaks the colouration for stubs.