Don't add a link to Special:RecentChanges when tag filter is disabled
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 10 Aug 2015 19:01:59 +0000 (21:01 +0200)
committerLegoktm <legoktm.wikipedia@gmail.com>
Fri, 14 Aug 2015 03:44:13 +0000 (03:44 +0000)
When wgUseTagFilter = false there is no need to link to
Special:RecentChanges because the special page cannot display the tag
filter and will show all changes, which is wrong.

Bug: T105650
Change-Id: I389aba9cb2862df3ba6980333c5cc94bb30dc202

includes/specials/SpecialTags.php

index a6847e1..70eee9f 100644 (file)
@@ -216,15 +216,17 @@ class SpecialTags extends SpecialPage {
                $newRow .= Xml::tags( 'td', null, $this->msg( $activeMsg )->escaped() );
 
                $hitcountLabel = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped();
-               $hitcountLink = Linker::link(
-                       SpecialPage::getTitleFor( 'Recentchanges' ),
-                       $hitcountLabel,
-                       array(),
-                       array( 'tagfilter' => $tag )
-               );
+               if ( $this->getConfig()->get( 'UseTagFilter' ) ) {
+                       $hitcountLabel = Linker::link(
+                               SpecialPage::getTitleFor( 'Recentchanges' ),
+                               $hitcountLabel,
+                               array(),
+                               array( 'tagfilter' => $tag )
+                       );
+               }
 
                // add raw $hitcount for sorting, because tags-hitcount contains numbers and letters
-               $newRow .= Xml::tags( 'td', array( 'data-sort-value' => $hitcount ), $hitcountLink );
+               $newRow .= Xml::tags( 'td', array( 'data-sort-value' => $hitcount ), $hitcountLabel );
 
                // actions
                if ( $showActions ) { // we've already checked that the user had the requisite userright