From 441de323cbcb23198651e790038f53b7278d7b36 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 16 Apr 2008 14:43:38 +0000 Subject: [PATCH] When hiding things on WhatLinksHere, generated URLs should hide them too. Note that there's still apparently a fairly significant pagination issue here (reported on WP:VPT, as was this): with certain combinations of hiding, results are filtered *after* the query, resulting in fewer than 50 rows returned, possibly 0, even if there are actually results. Also, it might be nice if it didn't let you hide *everything*. That's kind of silly. --- RELEASE-NOTES | 3 ++- includes/SpecialWhatlinkshere.php | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6aa1e70b6c..57359ef7a5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -185,10 +185,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13736) Don't show MediaWiki:Anontalkpagetext on non-existant IP addresses * (bug 13728) Don't trim initial whitespace during section edits * (bug 13727) Don't delete log entries from recentchanges on page deletion -* (bug 13752) Section redirects now works again +* (bug 13752) Redirects to sections now work again * (bug 13725) Upload form watch checkbox state set correctly with wpDestFile * (bug 13756) Don't show the form and navigation links of Special:Newpages if the page is included +* When hiding things on WhatLinksHere, generated URLs should hide them too === API changes in 1.13 === diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index 111d82b7c7..53b9b7aa2b 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -1,5 +1,6 @@ skin->makeKnownLinkObj( $this->selfTitle, $text, $query ); } + /** Get a query string to append to hide appropriate entries */ + function getHideParams() { + return ($this->hidetrans ? '&hidetrans=1' : '') + . ($this->hidelinks ? '&hidelinks=1' : '') + . ($this->hideredirs ? '&hideredirs=1' : ''); + } + function getPrevNext( $limit, $prevId, $nextId ) { global $wgLang; $fmtLimit = $wgLang->formatNum( $limit ); @@ -286,13 +294,15 @@ class WhatLinksHerePage { $nsText = "&namespace={$this->namespace}"; } + $hideParams = $this->getHideParams(); + if ( 0 != $prevId ) { - $prevLink = $this->makeSelfLink( $prev, "limit={$limit}&from={$this->back}{$nsText}" ); + $prevLink = $this->makeSelfLink( $prev, "limit={$limit}&from={$this->back}{$nsText}{$hideParams}" ); } else { $prevLink = $prev; } if ( 0 != $nextId ) { - $nextLink = $this->makeSelfLink( $next, "limit={$limit}&from={$nextId}&back={$prevId}{$nsText}" ); + $nextLink = $this->makeSelfLink( $next, "limit={$limit}&from={$nextId}&back={$prevId}{$nsText}{$hideParams}" ); } else { $nextLink = $next; } @@ -310,7 +320,7 @@ class WhatLinksHerePage { $query = "limit={$limit}&from={$from}"; if( is_int($this->namespace) ) { $query .= "&namespace={$this->namespace}";} $fmtLimit = $wgLang->formatNum( $limit ); - return $this->makeSelfLink( $fmtLimit, $query ); + return $this->makeSelfLink( $fmtLimit, $query.$this->getHideParams() ); } function whatlinkshereForm( $options = array( 'target' => '', 'namespace' => '' ) ) { -- 2.20.1