summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-07-10 16:20:40 +0300
committerAndrew Dolgov <[email protected]>2017-07-10 16:20:40 +0300
commit9f7bd151c6623397e35661200ff3f7aa8b3850d8 (patch)
treebd65a1fc635923dea25cbf24248c0cc33b1e3615 /install
parent1003cb24b99aa72f0d37c93ede4053f9d65849cf (diff)
hopefully unify handling of server HTTPS variables where needed, use scheme based on SELF_URL_PATH otherwise
Diffstat (limited to 'install')
-rwxr-xr-xinstall/index.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/install/index.php b/install/index.php
index 7da311ffb..4239f5893 100755
--- a/install/index.php
+++ b/install/index.php
@@ -22,7 +22,7 @@
$password = "";
$possible = "0123456789abcdfghjkmnpqrstvwxyzABCDFGHJKMNPQRSTVWXYZ*%+^";
- $i = 0;
+ $i = 0;
while ($i < $length) {
$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
@@ -179,8 +179,12 @@
}
}
+ function is_server_https() {
+ return $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
+ }
+
function make_self_url_path() {
- $url_path = ((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+ $url_path = (is_server_https() ? 'https://' : 'http://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
return $url_path;
}