mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-28 07:08:07 -05:00
try/catch for finfo_open
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user