1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 18:30:20 +02:00

Merge pull request #416 from thegeeex/dev

Update install.php to handle https requests
This commit is contained in:
Sergey Romanenko
2016-06-11 14:34:14 +03:00
committed by GitHub

View File

@@ -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, '/');