X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Fsanity_check.php;h=5c631574decf02b8b5f6444cb4d4ae1a578ac965;hb=5b7bd238eeed1aa83fe47f715c79b16b42ab347f;hp=4fe28c3075d34585244366ab73325a11ce666a52;hpb=566faa14760112f81eea78fe441d5adc1b872da1;p=tt-rss.git diff --git a/include/sanity_check.php b/include/sanity_check.php index 4fe28c30..5c631574 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -6,11 +6,15 @@ } else { define('EXPECTED_CONFIG_VERSION', 25); - define('SCHEMA_VERSION', 87); + define('SCHEMA_VERSION', 90); require_once "config.php"; require_once "sanity_config.php"; + if (function_exists('posix_getuid') && posix_getuid() == 0) { + $err_msg = "Please don't run this script as root."; + } + if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) { $err_msg = "Configuration file (config.php) has incorrect version. Update it with new options from config.php-dist and set CONFIG_VERSION to the correct value."; } @@ -116,7 +120,7 @@ } } - if ($err_msg) { ?> + if ($err_msg && defined($_SERVER['REQUEST_URI'])) { ?> Fatal error @@ -142,6 +146,8 @@