From f19d34a5a1e47e703ad5f5e5231cacdd900234eb Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 5 Aug 2017 15:19:15 +0200 Subject: [PATCH] [index] Check permissions for cache folder and whitelist file * The cache folder requires write permissions at all times * The whitelist file requires write permissions if it does not exist (can be created manually) --- index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.php b/index.php index b7387f52..03765dd3 100644 --- a/index.php +++ b/index.php @@ -71,6 +71,14 @@ if(!extension_loaded('libxml')) if(ini_get('allow_url_fopen') !== "1") die('"allow_url_fopen" is not set to "1". Please check "php.ini'); +// Check cache folder permissions (write permissions required) +if(!is_writable(CACHE_DIR)) + die('RSS-Bridge does not have write permissions for ' . CACHE_DIR . '!'); + +// Check whitelist file permissions (only in DEBUG mode) +if(!file_exists('./whitelist.txt') && !is_writable('./')) + die('RSS-Bridge does not have write permissions for ' . WHITELIST_FILE . '!'); + // FIXME : beta test UA spoofing, please report any blacklisting by PHP-fopen-unfriendly websites $userAgent = 'Mozilla/5.0(X11; Linux x86_64; rv:30.0)';