(bug 40679) Set $wgSecureLogin to false for $wgServers with schemes.
authorTyler Anthony Romeo <tylerromeo@gmail.com>
Mon, 8 Oct 2012 04:21:08 +0000 (00:21 -0400)
committerTyler Anthony Romeo <tylerromeo@gmail.com>
Fri, 14 Dec 2012 01:45:16 +0000 (20:45 -0500)
When $wgServer has a scheme, force $wgSecureLogin to false in order
to stop infinite redirects when trying to go to the login page.

Change-Id: I5792eb1a54c7b6279aad0531cedf9f7b4bf94e6e

includes/Setup.php

index 83ca516..f6c8245 100644 (file)
@@ -390,6 +390,11 @@ if ( !defined( 'MW_COMPILED' ) ) {
        wfProfileOut( $fname . '-includes' );
 }
 
+if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
+       $wgSecureLogin = false;
+       wfWarn( 'Secure login was enabled on a server that only supports HTTP or HTTPS. Disabling secure login.' );
+}
+
 # Now that GlobalFunctions is loaded, set defaults that depend
 # on it.
 if ( $wgTmpDirectory === false ) {