From: Andrew Dolgov Date: Wed, 5 Jul 2017 19:00:31 +0000 (+0300) Subject: sanity: check whether SELF_URL_PATH conforms to data returned by httpd X-Git-Tag: 17.12~152 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7506b61af259f24456ea44c2c31a915c634f0c5e;p=tt-rss.git sanity: check whether SELF_URL_PATH conforms to data returned by httpd --- diff --git a/include/sanity_check.php b/include/sanity_check.php index 83ff3673..3f5da764 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: $urlpath)"); + "Please set SELF_URL_PATH to the correct value for your server (possible value: $ref_self_url_path)"); } - 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: $ref_self_url_path"); + } + + if (!is_writable(ICONS_DIR)) { array_push($errors, "ICONS_DIR defined in config.php is not writable (chmod -R 777 ".ICONS_DIR.").\n"); }