Merge "Avoid an infinite redirect in $wgSecureLogin handling"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 May 2014 23:56:16 +0000 (23:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 May 2014 23:56:16 +0000 (23:56 +0000)
includes/specials/SpecialUserlogin.php

index 5ce2812..bee94f8 100644 (file)
@@ -193,7 +193,10 @@ class LoginForm extends SpecialPage {
                                'title' => null,
                        ) + $this->mRequest->getQueryValues();
                        $url = $title->getFullURL( $query, false, PROTO_HTTPS );
-                       if ( $wgSecureLogin && wfCanIPUseHTTPS( $this->getRequest()->getIP() ) ) {
+                       if ( $wgSecureLogin
+                               && wfCanIPUseHTTPS( $this->getRequest()->getIP() )
+                               && !$this->mFromHTTP ) // Avoid infinite redirect
+                       {
                                $url = wfAppendQuery( $url, 'fromhttp=1' );
                                $this->getOutput()->redirect( $url );
                                // Since we only do this redir to change proto, always vary