X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FRedirectSpecialPage.php;h=c28b89ea2ccc8c8b4d82163488c804526d6b5247;hb=e8f961b89b522810f685a7e399d30b3002df01b9;hp=01a88f49332c18aa98683d20288988425ea92d61;hpb=342749942bb05852b645bbda23bc60695c25ac79;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/RedirectSpecialPage.php b/includes/specialpage/RedirectSpecialPage.php index 01a88f4933..c28b89ea2c 100644 --- a/includes/specialpage/RedirectSpecialPage.php +++ b/includes/specialpage/RedirectSpecialPage.php @@ -35,23 +35,19 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { /** * @param string|null $subpage - * @return Title|bool */ public function execute( $subpage ) { $redirect = $this->getRedirect( $subpage ); - $query = $this->getRedirectQuery(); - // Redirect to a page title with possible query parameters + $query = $this->getRedirectQuery( $subpage ); + if ( $redirect instanceof Title ) { + // Redirect to a page title with possible query parameters $url = $redirect->getFullUrlForRedirect( $query ); $this->getOutput()->redirect( $url ); - - return $redirect; } elseif ( $redirect === true ) { // Redirect to index.php with query parameters $url = wfAppendQuery( wfScript( 'index' ), $query ); $this->getOutput()->redirect( $url ); - - return $redirect; } else { $this->showNoRedirectPage(); } @@ -70,9 +66,10 @@ 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. * + * @param string|null $subpage * @return array|bool */ - public function getRedirectQuery() { + public function getRedirectQuery( $subpage ) { $params = []; $request = $this->getRequest();