From 338b1f365678049c2ef24208b9ad340c4b97688d Mon Sep 17 00:00:00 2001 From: TheGeeex Date: Wed, 1 Jun 2016 13:57:17 +0200 Subject: [PATCH] Update install.php to handle https requests --- install.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install.php b/install.php index 150c6a1..cdbd7d2 100755 --- a/install.php +++ b/install.php @@ -24,15 +24,21 @@ // Get array with the names of all modules compiled and loaded $php_modules = get_loaded_extensions(); + // Protocol to use + $protocol = 'http'; + // Get server port if ($_SERVER["SERVER_PORT"] == "80") { $port = ""; + } elseif ($_SERVER["SERVER_PORT"] == "443") { + $port = ""; + $protocol = 'https'; } else { $port = ':'.$_SERVER["SERVER_PORT"]; } // Get site URL - $site_url = 'http://'.$_SERVER["SERVER_NAME"].$port.str_replace(array("index.php", "install.php"), "", $_SERVER['PHP_SELF']); + $site_url = $protocol . '://'.$_SERVER["SERVER_NAME"].$port.str_replace(array("index.php", "install.php"), "", $_SERVER['PHP_SELF']); // Replace last slash in site_url $site_url = rtrim($site_url, '/');