From 47472f70c726272e2a13704701f3235c23bb193f Mon Sep 17 00:00:00 2001 From: dairiki Date: Thu, 8 Nov 2001 22:39:26 +0000 Subject: [PATCH] Fixes based on SF patch #479769: Sse https: rather than http: in the autogenerated $ScriptUrl when mod_ssl is in use. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/branches/release-1_2-branch@624 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/config.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/config.php b/lib/config.php index cef3ead89..6f7a63764 100644 --- a/lib/config.php +++ b/lib/config.php @@ -10,7 +10,7 @@ if (!function_exists('rcs_id')) { function rcs_id($id) { echo "\n"; }; } - rcs_id('$Id: config.php,v 1.24.2.4 2001-11-07 03:23:20 wainstead Exp $'); + rcs_id('$Id: config.php,v 1.24.2.5 2001-11-08 22:39:26 dairiki Exp $'); // end essential internal stuff @@ -247,10 +247,22 @@ ////////////////////////////////////////////////////////////////////// // you shouldn't have to edit anyting below this line + function compute_default_scripturl() { + global $SERVER_PORT, $SERVER_NAME, $SCRIPT_NAME, $HTTPS; + if (!empty($HTTPS) && $HTTPS != 'off') { + $proto = 'https'; + $dflt_port = 443; + } + else { + $proto = 'http'; + $dflt_port = 80; + } + $port = ($SERVER_PORT == $dflt_port) ? '' : ":$SERVER_PORT"; + return $proto . '://' . $SERVER_NAME . $port . $SCRIPT_NAME; + } if (empty($ScriptUrl)) { - $port = ($SERVER_PORT == 80) ? '' : ":$SERVER_PORT"; - $ScriptUrl = "http://$SERVER_NAME$port$SCRIPT_NAME"; + $ScriptUrl = compute_default_scripturl(); } if (defined('WIKI_ADMIN') && !empty($AdminUrl)) $ScriptUrl = $AdminUrl; -- 2.45.0