From 92dfd544b5c6da823c9fb01c32648249311391a5 Mon Sep 17 00:00:00 2001 From: Glaisher Date: Tue, 9 Jun 2015 22:24:44 +0500 Subject: [PATCH] Allow 'uselang', 'useskin', 'debug' as query parameters in RedirectSpecialPages These are special cases which can be used in all these special pages so whitelist them. Also fixed error in documentation. Bug: T90390 Change-Id: Icc5e181533dc9825c877ccade4c80ea86ba19642 --- includes/specialpage/RedirectSpecialPage.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/specialpage/RedirectSpecialPage.php b/includes/specialpage/RedirectSpecialPage.php index a866ba7749..df1fa613f3 100644 --- a/includes/specialpage/RedirectSpecialPage.php +++ b/includes/specialpage/RedirectSpecialPage.php @@ -70,13 +70,15 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { * Return part of the request string for a special redirect page * This allows passing, e.g. action=history to Special:Mypage, etc. * - * @return string + * @return array|bool */ public function getRedirectQuery() { $params = array(); $request = $this->getRequest(); - foreach ( $this->mAllowedRedirectParams as $arg ) { + foreach ( array_merge( $this->mAllowedRedirectParams, + array( 'uselang', 'useskin', 'debug' ) // parameters which can be passed to all pages + ) as $arg ) { if ( $request->getVal( $arg, null ) !== null ) { $params[$arg] = $request->getVal( $arg ); } elseif ( $request->getArray( $arg, null ) !== null ) { @@ -205,7 +207,7 @@ abstract class RedirectSpecialArticle extends RedirectSpecialPage { 'section', 'oldid', 'diff', 'dir', 'limit', 'offset', 'feed', # Misc options - 'redlink', 'debug', + 'redlink', # Options for action=raw; missing ctype can break JS or CSS in some browsers 'ctype', 'maxage', 'smaxage', ); -- 2.20.1