Page MenuHomePhabricator

mediawiki-1.16-https-detect-fix.patch

Authored By
bzimport
Nov 22 2014, 1:15 AM
Size
910 B
Referenced Files
None
Subscribers
None

mediawiki-1.16-https-detect-fix.patch

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index ae6fc1b..f9d9941 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -66,14 +66,14 @@ if( isset( $_SERVER['SERVER_NAME'] ) ) {
$serverName = 'localhost';
}
-$wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
+$wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https' : 'http';
$wgServer = $wgProto.'://' . $serverName;
# If the port is a non-standard one, add it to the URL
if( isset( $_SERVER['SERVER_PORT'] )
&& !strpos( $serverName, ':' )
&& ( ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
- || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
+ || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 && $_SERVER['SERVER_PORT'] != 80 ) ) ) {
$wgServer .= ":" . $_SERVER['SERVER_PORT'];
}

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9791
Default Alt Text
mediawiki-1.16-https-detect-fix.patch (910 B)

Event Timeline