|
|
@ -24,7 +24,7 @@ function isImgMime($content) { |
|
|
|
function downloadHttp(&$url, $curlOptions = array()) { |
|
|
|
function downloadHttp(&$url, $curlOptions = array()) { |
|
|
|
syslog(LOG_INFO, 'FreshRSS Favicon GET ' . $url); |
|
|
|
syslog(LOG_INFO, 'FreshRSS Favicon GET ' . $url); |
|
|
|
if (substr($url, 0, 2) === '//') { |
|
|
|
if (substr($url, 0, 2) === '//') { |
|
|
|
$url = 'https:' . $favicon; |
|
|
|
$url = 'https:' . $url; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($url == '' || filter_var($url, FILTER_VALIDATE_URL) === false) { |
|
|
|
if ($url == '' || filter_var($url, FILTER_VALIDATE_URL) === false) { |
|
|
|
return ''; |
|
|
|
return ''; |
|
|
@ -36,7 +36,9 @@ function downloadHttp(&$url, $curlOptions = array()) { |
|
|
|
CURLOPT_USERAGENT => FRESHRSS_USERAGENT, |
|
|
|
CURLOPT_USERAGENT => FRESHRSS_USERAGENT, |
|
|
|
CURLOPT_MAXREDIRS => 10, |
|
|
|
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')) { |
|
|
|
if (defined('CURLOPT_ENCODING')) { |
|
|
|
curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings |
|
|
|
curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings |
|
|
|
} |
|
|
|
} |
|
|
|