Allow preloadparams for Special:MyPage
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 7 Sep 2014 17:20:34 +0000 (19:20 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 7 Sep 2014 17:36:00 +0000 (19:36 +0200)
The param was added with If02cf4b3dba9f9d22a956d8bfff224677cbce00d
This allows using it along with the already allowed preload=
The preloadparams is a array param, which needs support in
getRedirectQuery

Change-Id: Ib4f369a39d989c7038b735b862883641aa3aa354

includes/specialpage/RedirectSpecialPage.php

index cd41a1c..4226ee0 100644 (file)
@@ -71,10 +71,13 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
         */
        public function getRedirectQuery() {
                $params = array();
+               $request = $this->getRequest();
 
                foreach ( $this->mAllowedRedirectParams as $arg ) {
-                       if ( $this->getRequest()->getVal( $arg, null ) !== null ) {
-                               $params[$arg] = $this->getRequest()->getVal( $arg );
+                       if ( $request->getVal( $arg, null ) !== null ) {
+                               $params[$arg] = $request->getVal( $arg );
+                       } elseif ( $request->getArray( $arg, null ) !== null ) {
+                               $params[$arg] = $request->getArray( $arg );
                        }
                }
 
@@ -188,7 +191,7 @@ abstract class RedirectSpecialArticle extends RedirectSpecialPage {
                        'action',
                        'redirect', 'rdfrom',
                        # Options for preloaded edits
-                       'preload', 'editintro', 'preloadtitle', 'summary', 'nosummary',
+                       'preload', 'preloadparams', 'editintro', 'preloadtitle', 'summary', 'nosummary',
                        # Options for overriding user settings
                        'preview', 'minor', 'watchthis',
                        # Options for history/diffs