summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-07-13 08:57:31 +0300
committerAndrew Dolgov <[email protected]>2017-07-13 08:57:31 +0300
commite6d77d2b29e0b177bc5273fa90a99eacb1302b52 (patch)
tree0c60d2ba7c7fc8001530606897e8378d08888245 /install
parentb465c28ee038f93440ebb13ebfbbf529fd8149c7 (diff)
parentc9040c5c2e3960cd3668dd0cfe7621c5536ed37e (diff)
Merge branch 'master' of git.fakecake.org:tt-rss
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;
}