* Query parameters that can be passed through redirects
*/
var $mAllowedRedirectParams = array();
+ /**
+ * Query parameteres added by redirects
+ */
+ var $mAddedRedirectParams = array();
/**
* List of special pages, followed by parameters.
* If the only parameter is a string, that is the page name.
# Users and rights
'Blockip' => array( 'SpecialPage', 'Blockip', 'block' ),
'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ),
+ 'Unblock' => array( 'SpecialRedirectToSpecial', 'Unblock', 'Ipblocklist', false, array( 'uselang', 'ip', 'id' ), array( 'action' => 'unblock' ) ),
'Resetpass' => 'SpecialResetpass',
'DeletedContributions' => 'DeletedContributionsPage',
'Preferences' => 'SpecialPreferences',
if( ( $val = $wgRequest->getVal( $arg, null ) ) !== null )
$params[] = $arg . '=' . $val;
}
-
+
+ foreach( $this->mAddedRedirectParams as $arg => $val ) {
+ $params[] = $arg . '=' . $val;
+ }
+
return count( $params ) ? implode( '&', $params ) : false;
}
}
class SpecialRedirectToSpecial extends UnlistedSpecialPage {
var $redirName, $redirSubpage;
- function __construct( $name, $redirName, $redirSubpage = false, $redirectParams = array() ) {
+ function __construct( $name, $redirName, $redirSubpage = false, $allowedRedirectParams = array(), $addedRedirectParams = array() ) {
parent::__construct( $name );
$this->redirName = $redirName;
$this->redirSubpage = $redirSubpage;
- $this->mAllowedRedirectParams = $redirectParams;
+ $this->mAllowedRedirectParams = $allowedRedirectParams;
+ $this->mAddedRedirectParams = $addedRedirectParams;
}
function getRedirect( $subpage ) {