summaryrefslogtreecommitdiff
path: root/include/sanity_check.php
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 /include/sanity_check.php
parent1003cb24b99aa72f0d37c93ede4053f9d65849cf (diff)
hopefully unify handling of server HTTPS variables where needed, use scheme based on SELF_URL_PATH otherwise
Diffstat (limited to 'include/sanity_check.php')
-rwxr-xr-xinclude/sanity_check.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/include/sanity_check.php b/include/sanity_check.php
index ea7b0da80..964dce03c 100755
--- a/include/sanity_check.php
+++ b/include/sanity_check.php
@@ -15,7 +15,7 @@
* to get out. */
function make_self_url_path() {
- $proto = ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'https' : 'http';
+ $proto = is_server_https() ? 'https' : 'http';
$url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
return $url_path;
@@ -108,7 +108,7 @@
if (isset($_SERVER["HTTP_HOST"]) &&
(!defined('_SKIP_SELF_URL_PATH_CHECKS') || !_SKIP_SELF_URL_PATH_CHECKS) &&
- SELF_URL_PATH != $ref_self_url_path && SELF_URL_PATH != mb_substr($ref_self_url_path, 0, mb_strlen($ref_self_url_path)-1)) {
+ SELF_URL_PATH != $ref_self_url_path && SELF_URL_PATH != mb_substr($ref_self_url_path, 0, mb_strlen($ref_self_url_path)-1)) {
array_push($errors,
"Please set SELF_URL_PATH to the correct value detected for your server: <b>$ref_self_url_path</b>");
}
@@ -152,12 +152,6 @@
if (!class_exists("DOMDocument")) {
array_push($errors, "PHP support for DOMDocument is required, but was not found.");
}
-
- $self_scheme = parse_url(SELF_URL_PATH, PHP_URL_SCHEME);
-
- if ($_SERVER['HTTPS'] && $self_scheme == 'http') {
- array_push($errors, "You are accessing tt-rss over SSL but SELF_URL_PATH in config.php refers to a http:// URL.");
- }
}
if (count($errors) > 0 && $_SERVER['REQUEST_URI']) { ?>