aboutsummaryrefslogtreecommitdiff
path: root/lib/favicons.php
diff options
context:
space:
mode:
authorGravatar Kevin Papst <kevinpapst@users.noreply.github.com> 2017-12-17 17:46:04 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-12-17 17:46:04 +0100
commitbe3ed001a4803b4279c34249f20ebffc13c8cc9b (patch)
treeaf71eba6748387241139fae6b21674d61420a593 /lib/favicons.php
parent25a51f045dbbd1188d1149cde40c1df17111c41a (diff)
Fix favicon for open_basedir (#1733)
Remove open_basedir warning for CURLOPT_FOLLOWLOCATION with PHP 5.6.0- https://bugs.php.net/bug.php?id=65646
Diffstat (limited to 'lib/favicons.php')
-rw-r--r--lib/favicons.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/favicons.php b/lib/favicons.php
index 2d6f7aab7..75e40900a 100644
--- a/lib/favicons.php
+++ b/lib/favicons.php
@@ -24,7 +24,7 @@ function isImgMime($content) {
function downloadHttp(&$url, $curlOptions = array()) {
syslog(LOG_INFO, 'FreshRSS Favicon GET ' . $url);
if (substr($url, 0, 2) === '//') {
- $url = 'https:' . $favicon;
+ $url = 'https:' . $url;
}
if ($url == '' || filter_var($url, FILTER_VALIDATE_URL) === false) {
return '';
@@ -36,7 +36,9 @@ function downloadHttp(&$url, $curlOptions = array()) {
CURLOPT_USERAGENT => FRESHRSS_USERAGENT,
CURLOPT_MAXREDIRS => 10,
));
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //Keep option separated for open_basedir bug
+ if (ini_get('open_basedir') == '') { // see PHP bug 65646
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ }
if (defined('CURLOPT_ENCODING')) {
curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings
}