Fix sourceforge bug 930986
authorAntoine Musso <hashar@users.mediawiki.org>
Wed, 7 Apr 2004 11:36:01 +0000 (11:36 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Wed, 7 Apr 2004 11:36:01 +0000 (11:36 +0000)
"http" was hardcoded for $wgServer, implement a check if $_SERVER["HTTPS"] exist.
Thanks to Jan Legenhausen (jleg@users.sourceforge.net)

includes/DefaultSettings.php

index 0b7b395..ab2ccf6 100644 (file)
@@ -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";