http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90775

Revision: 90775
Author:   reedy
Date:     2011-06-25 16:41:29 +0000 (Sat, 25 Jun 2011)
Log Message:
-----------
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: trunk/phase3/includes/specials/SpecialContributions.php
===================================================================
--- trunk/phase3/includes/specials/SpecialContributions.php     2011-06-25 
16:32:03 UTC (rev 90774)
+++ trunk/phase3/includes/specials/SpecialContributions.php     2011-06-25 
16:41:29 UTC (rev 90775)
@@ -115,6 +115,41 @@
                        $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() ) );
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to