Skip to content

Commit

Permalink
Update install.php to handle https requests
Browse files Browse the repository at this point in the history
  • Loading branch information
GauBen committed Jun 1, 2016
1 parent 95f8c47 commit 338b1f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/');
Expand Down

0 comments on commit 338b1f3

Please sign in to comment.