(bug 33471) Changed detection of secure cookies.
authorTyler Romeo <tylerromeo@gmail.com>
Fri, 10 Aug 2012 20:27:13 +0000 (16:27 -0400)
committerTyler Romeo <tylerromeo@gmail.com>
Fri, 10 Aug 2012 20:27:13 +0000 (16:27 -0400)
Changed code in Setup.php that checks whether or
not to use secure cookies. Previously it just
looked at $wgServer, which doesn't work with
protocol-relative URLs. Now it uses WebRequest::detectProtocol(),
which in turn checks $_SERVER.

Change-Id: I6adc7e3e9bd224608b13cbb748bdd2b61edaa764
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
includes/Setup.php

index 518ef6d..baf7b35 100644 (file)
@@ -372,7 +372,7 @@ if ( $wgNewUserLog ) {
 }
 
 if ( $wgCookieSecure === 'detect' ) {
-       $wgCookieSecure = ( substr( $wgServer, 0, 6 ) === 'https:' );
+       $wgCookieSecure = ( WebRequest::detectProtocol() === 'https:' );
 }
 
 // Disable MWDebug for command line mode, this prevents MWDebug from eating up