r90775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90774‎ | r90775 | r90776 >
Date:16:41, 25 June 2011
Author:reedy
Status:resolved
Tags:
Comment:
Followup r89566

Per CR, add HTTP redirect from old feed listing on Special:Contributions to using the api module output
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -115,6 +115,41 @@
116116 $this->opts['month'] = $wgRequest->getIntOrNull( 'month' );
117117 }
118118
 119+ $feedType = $wgRequest->getVal( 'feed' );
 120+ if( $feedType ) {
 121+ $apiParams = array(
 122+ 'action' => 'feedcontributions',
 123+ 'feedformat' => $feedType,
 124+ 'user' => $target,
 125+ );
 126+ if ( $this->opts['topOnly'] ) {
 127+ $apiParams['toponly'] = true;
 128+ }
 129+ if ( $this->opts['showSizeDiff'] ) {
 130+ $apiParams['showsizediff'] = true;
 131+ }
 132+ if ( $this->opts['deletedonly'] ) {
 133+ $apiParams['deletedonly'] = true;
 134+ }
 135+ if ( $this->opts['tagFilter'] !== '' ) {
 136+ $apiParams['tagfilter'] = $this->opts['tagFilter'];
 137+ }
 138+ if ( $this->opts['namespace'] !== '' ) {
 139+ $apiParams['namespace'] = $this->opts['namespace'];
 140+ }
 141+ if ( $this->opts['year'] !== null ) {
 142+ $apiParams['year'] = $this->opts['year'];
 143+ }
 144+ if ( $this->opts['month'] !== null ) {
 145+ $apiParams['month'] = $this->opts['month'];
 146+ }
 147+
 148+ $url = wfScript( 'api' ) . '?' . wfArrayToCGI( $apiParams );
 149+
 150+ $wgOut->redirect( $url, '301' );
 151+ return;
 152+ }
 153+
119154 // Add RSS/atom links
120155 $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $wgUser->getName() ) );
121156

Follow-up revisions

RevisionCommit summaryAuthorDate
r90839Followup r90775: Fix PHP Notice: Undefined index: deletedonly in /www/w/incl...raymond17:36, 26 June 2011
r90847Followup r89566, r89568, make links point to the user whom the contributions ...reedy19:33, 26 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89566Followup r89564...reedy14:56, 6 June 2011

Status & tagging log