MediaWiki  REL1_24
SpecialDiff.php
Go to the documentation of this file.
00001 <?php
00039 class SpecialDiff extends RedirectSpecialPage {
00040     function __construct() {
00041         parent::__construct( 'Diff' );
00042         $this->mAllowedRedirectParams = array();
00043     }
00044 
00045     function getRedirect( $subpage ) {
00046         $parts = explode( '/', $subpage );
00047 
00048         // Try to parse the values given, generating somewhat pretty URLs if possible
00049         if ( count( $parts ) === 1 && $parts[0] !== '' ) {
00050             $this->mAddedRedirectParams['diff'] = $parts[0];
00051         } elseif ( count( $parts ) === 2 ) {
00052             $this->mAddedRedirectParams['oldid'] = $parts[0];
00053             $this->mAddedRedirectParams['diff'] = $parts[1];
00054         } else {
00055             // Wrong number of parameters, bail out
00056             throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
00057         }
00058 
00059         return true;
00060     }
00061 }