From 7d8aea28412045f1b834d3176d2942e1670db50e Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Fri, 29 Apr 2005 07:41:50 +0000 Subject: [PATCH] Bug 1980 - Port 443 added to https / SSL URLs --- includes/DefaultSettings.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index a7706ce795..859f5497d4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -43,7 +43,11 @@ if( isset( $_SERVER['SERVER_NAME'] ) ) { $wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; $wgServer = $wgProto.'://' . $wgServerName; -if( isset( $_SERVER['SERVER_PORT'] ) && $_SERVER['SERVER_PORT'] != 80 ) { +# If the port is a non-standard one, add it to the URL +if( isset( $_SERVER['SERVER_PORT'] ) + && ( ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 ) + || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) { + $wgServer .= ":" . $_SERVER['SERVER_PORT']; } unset($wgProto); -- 2.20.1