From: Antoine Musso Date: Wed, 7 Apr 2004 11:36:01 +0000 (+0000) Subject: Fix sourceforge bug 930986 X-Git-Tag: 1.3.0beta1~574 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=2d56585f6fa70b9a780008f697403e31f5f65d93;p=lhc%2Fweb%2Fwiklou.git Fix sourceforge bug 930986 "http" was hardcoded for $wgServer, implement a check if $_SERVER["HTTPS"] exist. Thanks to Jan Legenhausen (jleg@users.sourceforge.net) --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0b7b395679..ab2ccf669e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -11,12 +11,17 @@ $wgVersion = "1.3.0pre-alpha"; $wgSitename = "MediaWiki"; # Please customize! $wgMetaNamespace = FALSE; # will be same as you set $wgSitename + +# check if server use https: +$wgProto = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https" : "http"; + if ( @$wgCommandLineMode ) { - $wgServer = "http://localhost"; + $wgServer = $wgProto."://localhost"; } else { - $wgServer = "http://" . $_SERVER["SERVER_NAME"]; + $wgServer = $wgProto."://" . $_SERVER["SERVER_NAME"]; if( $_SERVER["SERVER_PORT"] != 80 ) $wgServer .= ":" . $_SERVER["SERVER_PORT"]; } +unset($wgProto); $wgScriptPath = "/wiki";