diff options
author | Andrew Dolgov <[email protected]> | 2013-03-28 10:10:55 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-28 10:14:10 +0400 |
commit | 24ff3b44d2713b5e7444a3065476fd9274953aea (patch) | |
tree | fe3d4949057efccac0e12ef8b1d5487cc1f33196 /include/sanity_check.php | |
parent | 9427ba1d431394dd2c30fedfc49cc797dd5dc752 (diff) |
sanity check: better suggestion for SELF_URL_PATH
Diffstat (limited to 'include/sanity_check.php')
-rw-r--r-- | include/sanity_check.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/sanity_check.php b/include/sanity_check.php index b2cb8ab45..1610cfeb0 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -2,6 +2,12 @@ // WARNING: Don't ask for help on tt-rss.org forums or the bugtracker if you have // modified this file. + function make_self_url_path() { + $url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); + + return $url_path; + } + function initial_sanity_check($link) { $errors = array(); @@ -69,12 +75,10 @@ } if (SELF_URL_PATH == "http://yourserver/tt-rss/") { - if ($_SERVER['HTTP_REFERER']) { - array_push($errors, - "Please set SELF_URL_PATH to the correct value for your server (possible value: <b>" . $_SERVER['HTTP_REFERER'] . "</b>)"); - } else { - array_push($errors, "Please set SELF_URL_PATH to the correct value for your server."); - } + $urlpath = preg_replace("/\w+\.php$/", "", make_self_url_path()); + + array_push($errors, + "Please set SELF_URL_PATH to the correct value for your server (possible value: <b>$urlpath</b>)"); } if (!is_writable(ICONS_DIR)) { |