A free, self-hostable news aggregator…
Remove warning for CURLOPT_FOLLOWLOCATION with open_basedir (#1734)
Alexandre Alapetitee399bc4b929b
diff --git a/app/Models/Feed.php b/app/Models/Feed.phpindex 75d9f6d6f..560f7415d 100644--- a/app/Models/Feed.php+++ b/app/Models/Feed.php@@ -491,7 +491,9 @@ class FreshRSS_Feed extends Minz_Model {CURLOPT_USERAGENT => FRESHRSS_USERAGENT,CURLOPT_MAXREDIRS => 10,));- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //Keep option separated for open_basedir bug+ if (version_compare(PHP_VERSION, '5.6.0') >= 0 || ini_get('open_basedir') == '') {+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //Keep option separated for open_basedir PHP bug 65646+ }if (defined('CURLOPT_ENCODING')) {curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings}diff --git a/lib/favicons.php b/lib/favicons.phpindex 75e40900a..fe2e65f1f 100644--- a/lib/favicons.php+++ b/lib/favicons.php@@ -36,8 +36,8 @@ function downloadHttp(&$url, $curlOptions = array()) {CURLOPT_USERAGENT => FRESHRSS_USERAGENT,CURLOPT_MAXREDIRS => 10,));- if (ini_get('open_basedir') == '') { // see PHP bug 65646- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);+ if (version_compare(PHP_VERSION, '5.6.0') >= 0 || ini_get('open_basedir') == '') {+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //Keep option separated for open_basedir PHP bug 65646}if (defined('CURLOPT_ENCODING')) {curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings