More rigorous fix for ImageMagick parameter interpretation (bug 23148 etc.) based...
[lhc/web/wiklou.git] / includes / SpecialPage.php
index 9176444..bfd8bba 100644 (file)
@@ -69,6 +69,10 @@ class SpecialPage {
         * 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.
@@ -118,6 +122,7 @@ class SpecialPage {
                # 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',
@@ -176,7 +181,7 @@ class SpecialPage {
                # Unlisted / redirects
                'Blankpage'                 => 'SpecialBlankpage',
                'Blockme'                   => array( 'UnlistedSpecialPage', 'Blockme' ),
-               'Emailuser'                 => array( 'UnlistedSpecialPage', 'Emailuser' ),
+               'Emailuser'                 => 'SpecialEmailUser',
                'Listadmins'                => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
                'Listbots'                  => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
                'Movepage'                  => array( 'UnlistedSpecialPage', 'Movepage' ),
@@ -883,7 +888,11 @@ Perhaps no page aliases are defined for it?" );
                        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;
        }
 }
@@ -917,11 +926,12 @@ class IncludableSpecialPage extends SpecialPage
 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 ) {