Include miscellaneous query parameters in $wgSecureLogin redirect
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 16 Oct 2013 14:29:39 +0000 (10:29 -0400)
committerAnomie <bjorsch@wikimedia.org>
Wed, 16 Oct 2013 15:26:29 +0000 (15:26 +0000)
The redirect from http to https should include any extra query
parameters, such as the ones for "campaigns".

But we still want to override returnto and returntoquery (in case they
were changed in ::load(), e.g. lines 139–140), and we omit any 'title'
parameter that may have been passed.

Bug: 55761
Change-Id: Icc8b4132e8682d782b0c049631328b94745eb355

includes/specials/SpecialUserlogin.php

index 2b60ca2..90c4c35 100644 (file)
@@ -173,7 +173,8 @@ class LoginForm extends SpecialPage {
                        $query = array(
                                'returnto' => $this->mReturnTo,
                                'returntoquery' => $this->mReturnToQuery,
-                       );
+                               'title' => null,
+                       ) + $this->mRequest->getQueryValues();
                        $url = $title->getFullURL( $query, false, PROTO_HTTPS );
                        if ( $wgSecureLogin && wfCanIPUseHTTPS( $this->getRequest()->getIP() ) ) {
                                $url = wfAppendQuery( $url, 'fromhttp=1' );