Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10307
mediawiki-1.16-https-detect-fix.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 22 2014, 1:15 AM
2014-11-22 01:15:25 (UTC+0)
Size
910 B
Referenced Files
None
Subscribers
None
mediawiki-1.16-https-detect-fix.patch
View Options
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
Details
Attached
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)
Attached To
Mode
T48511: HTTPS detection is not reliable
Attached
Detach File
Event Timeline
Log In to Comment