From 3bcd98404b0c6a5c6029daca44ceb37cd1581c32 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 5 Nov 2016 13:02:48 +0100 Subject: [PATCH 1/3] [index] Add check for correct PHP version --- index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 112589b..24b5e79 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,9 @@ TODO : - implement header('X-Cached-Version: '.date(DATE_ATOM, filemtime($cachefile))); */ +// Defines the minimum required PHP version for RSS-Bridge +define('PHP_VERSION_REQUIRED', '5.6.0'); + //define('PROXY_URL', 'tcp://192.168.0.0:28'); // Set to true if you allow users to disable proxy usage for specific bridges define('PROXY_BYBRIDGE', false); @@ -50,6 +53,10 @@ if(file_exists('DEBUG')){ require_once __DIR__ . '/lib/RssBridge.php'; +// Check PHP version +if(version_compare(PHP_VERSION, PHP_VERSION_REQUIRED) === -1) + die('RSS-Bridge requires at least PHP version ' . PHP_VERSION_REQUIRED . '!'); + // extensions check if(!extension_loaded('openssl')) die('"openssl" extension not loaded. Please check "php.ini"'); @@ -126,7 +133,7 @@ try { } $params = $_GET; - + // Initialize cache $cache = Cache::create('FileCache'); $cache->setPath(CACHE_DIR); From 04a195361aca7f2ea41da1cb1ff5e20ec720aea7 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 5 Nov 2016 13:05:28 +0100 Subject: [PATCH 2/3] [index] Add check for 'libxml' extension --- index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.php b/index.php index 24b5e79..91909a4 100644 --- a/index.php +++ b/index.php @@ -61,6 +61,9 @@ if(version_compare(PHP_VERSION, PHP_VERSION_REQUIRED) === -1) if(!extension_loaded('openssl')) die('"openssl" extension not loaded. Please check "php.ini"'); +if(!extension_loaded('libxml')) + die('"libxml" extension not loaded. Please check "php.ini"'); + // FIXME : beta test UA spoofing, please report any blacklisting by PHP-fopen-unfriendly websites ini_set('user_agent', 'Mozilla/5.0(X11; Linux x86_64; rv:30.0) Gecko/20121202 Firefox/30.0(rss-bridge/0.1; From d39c1ed63ad9c4b7d5d4573f020a51965e0cd4ad Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 5 Nov 2016 13:09:20 +0100 Subject: [PATCH 3/3] [index] Add check for 'allow_url_fopen' --- index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.php b/index.php index 91909a4..b4ae384 100644 --- a/index.php +++ b/index.php @@ -64,6 +64,10 @@ if(!extension_loaded('openssl')) if(!extension_loaded('libxml')) die('"libxml" extension not loaded. Please check "php.ini"'); +// configuration checks +if(ini_get('allow_url_fopen') !== "1") + die('"allow_url_fopen" is not set to "1". Please check "php.ini'); + // FIXME : beta test UA spoofing, please report any blacklisting by PHP-fopen-unfriendly websites ini_set('user_agent', 'Mozilla/5.0(X11; Linux x86_64; rv:30.0) Gecko/20121202 Firefox/30.0(rss-bridge/0.1;