From: Sam Reed Date: Sat, 25 Jun 2011 16:41:29 +0000 (+0000) Subject: Followup r89566 X-Git-Tag: 1.31.0-rc.0~29282 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=33260663286776566647841d4e9cd109dc70f3bc;p=lhc%2Fweb%2Fwiklou.git Followup r89566 Per CR, add HTTP redirect from old feed listing on Special:Contributions to using the api module output --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 0497f8f9b2..0c6560d21f 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -115,6 +115,41 @@ class SpecialContributions extends SpecialPage { $this->opts['month'] = $wgRequest->getIntOrNull( 'month' ); } + $feedType = $wgRequest->getVal( 'feed' ); + if( $feedType ) { + $apiParams = array( + 'action' => 'feedcontributions', + 'feedformat' => $feedType, + 'user' => $target, + ); + if ( $this->opts['topOnly'] ) { + $apiParams['toponly'] = true; + } + if ( $this->opts['showSizeDiff'] ) { + $apiParams['showsizediff'] = 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 = wfScript( 'api' ) . '?' . wfArrayToCGI( $apiParams ); + + $wgOut->redirect( $url, '301' ); + return; + } + // Add RSS/atom links $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $wgUser->getName() ) );