aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/Favicon/Favicon.php12
2 files changed, 9 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index de9f2cc5d..e8a15ad1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@
* Bug fixing
* Fix SQL uniqueness bug with PostgreSQL [#1476](https://github.com/FreshRSS/FreshRSS/pull/1476)
* (Require manual update for existing installations)
+ * Do not require PHP extension `fileinfo` for favicons [#1461](https://github.com/FreshRSS/FreshRSS/issues/1461)
* Fix UI lowest subscription popup hidden [#1479](https://github.com/FreshRSS/FreshRSS/issues/1479)
* I18n
* Improve English [#1465](https://github.com/FreshRSS/FreshRSS/pull/1465)
diff --git a/lib/Favicon/Favicon.php b/lib/Favicon/Favicon.php
index 4ee42ebbc..85d2ef19b 100644
--- a/lib/Favicon/Favicon.php
+++ b/lib/Favicon/Favicon.php
@@ -229,10 +229,14 @@ class Favicon
$fileContent = $this->dataAccess->retrieveUrl($url);
$this->dataAccess->saveCache($tmpFile, $fileContent);
- $finfo = finfo_open(FILEINFO_MIME_TYPE);
- $isImage = strpos(finfo_file($finfo, $tmpFile), 'image') !== false;
- finfo_close($finfo);
-
+ $isImage = true;
+ try {
+ $finfo = finfo_open(FILEINFO_MIME_TYPE);
+ $isImage = strpos(finfo_file($finfo, $tmpFile), 'image') !== false;
+ finfo_close($finfo);
+ } catch (Exception $e) {
+ }
+
unlink($tmpFile);
return $isImage;