summaryrefslogtreecommitdiff
path: root/include/sanity_check.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-07-05 22:00:31 +0300
committerAndrew Dolgov <[email protected]>2017-07-05 22:00:31 +0300
commit7506b61af259f24456ea44c2c31a915c634f0c5e (patch)
treea7fa7f697b963e5beab39ecf6109de909bee89d7 /include/sanity_check.php
parent890a7be0c63af9ca8bc36b521fda0a8e043906f6 (diff)
sanity: check whether SELF_URL_PATH conforms to data returned by httpd
Diffstat (limited to 'include/sanity_check.php')
-rwxr-xr-xinclude/sanity_check.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/sanity_check.php b/include/sanity_check.php
index 83ff36737..3f5da764f 100755
--- a/include/sanity_check.php
+++ b/include/sanity_check.php
@@ -97,14 +97,20 @@
}
}
- if (SELF_URL_PATH == "http://example.org/tt-rss/") {
- $urlpath = preg_replace("/\w+\.php$/", "", make_self_url_path());
+ $ref_self_url_path = make_self_url_path();
+ $ref_self_url_path = preg_replace("/\w+\.php$/", "", $ref_self_url_path);
+ if (SELF_URL_PATH == "http://example.org/tt-rss/") {
array_push($errors,
- "Please set SELF_URL_PATH to the correct value for your server (possible value: <b>$urlpath</b>)");
+ "Please set SELF_URL_PATH to the correct value for your server (possible value: <b>$ref_self_url_path</b>)");
}
- if (!is_writable(ICONS_DIR)) {
+ if (SELF_URL_PATH != $ref_self_url_path && (!defined('_SKIP_SELF_URL_PATH_CHECKS') || !_SKIP_SELF_URL_PATH_CHECKS)) {
+ array_push($errors,
+ "Please set SELF_URL_PATH to the correct value detected for your server: <b>$ref_self_url_path</b>");
+ }
+
+ if (!is_writable(ICONS_DIR)) {
array_push($errors, "ICONS_DIR defined in config.php is not writable (chmod -R 777 ".ICONS_DIR.").\n");
}