IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/97078


Change subject: Only put returnto parameter if needed on the from-http redirect 
in Special:Userlogin
......................................................................

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
---
M includes/specials/SpecialUserlogin.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/78/97078/1

diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index 9764c9f..b8e7d24 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -171,8 +171,9 @@
                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 );

-- 
To view, visit https://gerrit.wikimedia.org/r/97078
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49a085feaa49d4b2954ff280db241234d2d46258
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <coderev...@emsenhuber.ch>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to