Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -70,6 +70,10 @@ |
71 | 71 | */ |
72 | 72 | var $mAllowedRedirectParams = array(); |
73 | 73 | /** |
| 74 | + * Query parameteres added by redirects |
| 75 | + */ |
| 76 | + var $mAddedRedirectParams = array(); |
| 77 | + /** |
74 | 78 | * List of special pages, followed by parameters. |
75 | 79 | * If the only parameter is a string, that is the page name. |
76 | 80 | * Otherwise, it is an array. The format is one of: |
— | — | @@ -118,6 +122,7 @@ |
119 | 123 | # Users and rights |
120 | 124 | 'Blockip' => array( 'SpecialPage', 'Blockip', 'block' ), |
121 | 125 | 'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ), |
| 126 | + 'Unblock' => array( 'SpecialRedirectToSpecial', 'Unblock', 'Ipblocklist', false, array( 'uselang', 'ip', 'id' ), array( 'action' => 'unblock' ) ), |
122 | 127 | 'Resetpass' => 'SpecialResetpass', |
123 | 128 | 'DeletedContributions' => 'DeletedContributionsPage', |
124 | 129 | 'Preferences' => 'SpecialPreferences', |
— | — | @@ -883,7 +888,11 @@ |
884 | 889 | if( ( $val = $wgRequest->getVal( $arg, null ) ) !== null ) |
885 | 890 | $params[] = $arg . '=' . $val; |
886 | 891 | } |
887 | | - |
| 892 | + |
| 893 | + foreach( $this->mAddedRedirectParams as $arg => $val ) { |
| 894 | + $params[] = $arg . '=' . $val; |
| 895 | + } |
| 896 | + |
888 | 897 | return count( $params ) ? implode( '&', $params ) : false; |
889 | 898 | } |
890 | 899 | } |
— | — | @@ -917,11 +926,12 @@ |
918 | 927 | class SpecialRedirectToSpecial extends UnlistedSpecialPage { |
919 | 928 | var $redirName, $redirSubpage; |
920 | 929 | |
921 | | - function __construct( $name, $redirName, $redirSubpage = false, $redirectParams = array() ) { |
| 930 | + function __construct( $name, $redirName, $redirSubpage = false, $allowedRedirectParams = array(), $addedRedirectParams = array() ) { |
922 | 931 | parent::__construct( $name ); |
923 | 932 | $this->redirName = $redirName; |
924 | 933 | $this->redirSubpage = $redirSubpage; |
925 | | - $this->mAllowedRedirectParams = $redirectParams; |
| 934 | + $this->mAllowedRedirectParams = $allowedRedirectParams; |
| 935 | + $this->mAddedRedirectParams = $addedRedirectParams; |
926 | 936 | } |
927 | 937 | |
928 | 938 | function getRedirect( $subpage ) { |