From 1a9d24d0dd4186a4f322926a6b152c13a1c3707a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 17 Oct 2024 10:42:12 +0200 Subject: Fix favicon error in case of wrong URL (#6899) fix https://github.com/FreshRSS/FreshRSS/issues/6898 --- lib/favicons.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/favicons.php b/lib/favicons.php index 92394c09e..be83b8066 100644 --- a/lib/favicons.php +++ b/lib/favicons.php @@ -25,10 +25,11 @@ function isImgMime(string $content): bool { /** @param array $curlOptions */ function downloadHttp(string &$url, array $curlOptions = []): string { syslog(LOG_INFO, 'FreshRSS Favicon GET ' . $url); - $url = checkUrl($url); - if ($url == false) { + $url2 = checkUrl($url); + if ($url2 == false) { return ''; } + $url = $url2; /** @var CurlHandle $ch */ $ch = curl_init($url); curl_setopt_array($ch, [ @@ -56,7 +57,7 @@ function downloadHttp(string &$url, array $curlOptions = []): string { curl_close($ch); if (!empty($info['url'])) { $url2 = checkUrl($info['url']); - if ($url2 != '') { + if ($url2 != false) { $url = $url2; //Possible redirect } } -- cgit v1.2.3