diff options
| author | 2024-10-17 10:42:12 +0200 | |
|---|---|---|
| committer | 2024-10-17 10:42:12 +0200 | |
| commit | 1a9d24d0dd4186a4f322926a6b152c13a1c3707a (patch) | |
| tree | 28bbe95a9582eff7181ce87e0dc988ea179e0d9d | |
| parent | 24a4fcb5c3a001ee9810d7140f107160472fc1d5 (diff) | |
Fix favicon error in case of wrong URL (#6899)
fix https://github.com/FreshRSS/FreshRSS/issues/6898
| -rw-r--r-- | lib/favicons.php | 7 |
1 files changed, 4 insertions, 3 deletions
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<int,int|bool> $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 } } |
