From: mrbluesky Date: Sat, 18 Jan 2014 21:46:59 +0000 (+0100) Subject: Special:Contributions: add all params to feed URL X-Git-Tag: 1.31.0-rc.0~17062 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=324587bad4ee91b673f313c27c651fceaeb70967;p=lhc%2Fweb%2Fwiklou.git Special:Contributions: add all params to feed URL On Special:Contributions, the parameters namespace, year, month, tagfilter, deletedonly, toponly are not applied to the feed link in the toolbox (action=feedcontributions). Bug: 54093 Change-Id: Ib070b53786360d1c4911e0e4b50e61140466526c --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index b5b67c9d29..c5948076e7 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -132,34 +132,37 @@ class SpecialContributions extends IncludableSpecialPage { } $feedType = $request->getVal( 'feed' ); + + $feedParams = array( + 'action' => 'feedcontributions', + 'user' => $target, + ); + if ( $this->opts['topOnly'] ) { + $feedParams['toponly'] = true; + } + if ( $this->opts['deletedOnly'] ) { + $feedParams['deletedonly'] = true; + } + if ( $this->opts['tagfilter'] !== '' ) { + $feedParams['tagfilter'] = $this->opts['tagfilter']; + } + if ( $this->opts['namespace'] !== '' ) { + $feedParams['namespace'] = $this->opts['namespace']; + } + // Don't use year and month for the feed URL, but pass them on if + // we redirect to API (if $feedType is specified) + if ( $feedType && $this->opts['year'] !== null ) { + $feedParams['year'] = $this->opts['year']; + } + if ( $feedType && $this->opts['month'] !== null ) { + $feedParams['month'] = $this->opts['month']; + } + if ( $feedType ) { // Maintain some level of backwards compatability // If people request feeds using the old parameters, redirect to API - $apiParams = array( - 'action' => 'feedcontributions', - 'feedformat' => $feedType, - 'user' => $target, - ); - if ( $this->opts['topOnly'] ) { - $apiParams['toponly'] = true; - } - if ( $this->opts['deletedOnly'] ) { - $apiParams['deletedonly'] = true; - } - if ( $this->opts['tagfilter'] !== '' ) { - $apiParams['tagfilter'] = $this->opts['tagfilter']; - } - if ( $this->opts['namespace'] !== '' ) { - $apiParams['namespace'] = $this->opts['namespace']; - } - if ( $this->opts['year'] !== null ) { - $apiParams['year'] = $this->opts['year']; - } - if ( $this->opts['month'] !== null ) { - $apiParams['month'] = $this->opts['month']; - } - - $url = wfAppendQuery( wfScript( 'api' ), $apiParams ); + $feedParams['feedformat'] = $feedType; + $url = wfAppendQuery( wfScript( 'api' ), $feedParams ); $out->redirect( $url, '301' ); @@ -167,7 +170,7 @@ class SpecialContributions extends IncludableSpecialPage { } // Add RSS/atom links - $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $target ) ); + $this->addFeedLinks( $feedParams ); if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id, $userObj, $this ) ) ) { if ( !$this->including() ) {