From d27fcb42de130fa6fe95e8dfd37d4d271c637700 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 22 Nov 2013 20:36:17 +0100 Subject: [PATCH] Only put returnto parameter if needed on the from-http redirect in Special:Userlogin The default value of the $mReturnTo and $mReturnToQuery member variables is '', even if they were not passed. This means that they would always be present in the redirected URL when accessing Special:Userlogin from HTTP and HTTPS is available. Now the special case '' is changed to null so that they don't appear anymore if not needed. Change-Id: I49a085feaa49d4b2954ff280db241234d2d46258 --- includes/specials/SpecialUserlogin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index bbe56ecca3..69013b046a 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -172,8 +172,9 @@ class LoginForm extends SpecialPage { if ( $this->mRequest->getProtocol() !== 'https' ) { $title = $this->getFullTitle(); $query = array( - 'returnto' => $this->mReturnTo, - 'returntoquery' => $this->mReturnToQuery, + 'returnto' => $this->mReturnTo !== '' ? $this->mReturnTo : null, + 'returntoquery' => $this->mReturnToQuery !== '' ? + $this->mReturnToQuery : null, 'title' => null, ) + $this->mRequest->getQueryValues(); $url = $title->getFullURL( $query, false, PROTO_HTTPS ); -- 2.20.1