aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-04-10 19:46:22 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-04-10 19:46:22 +0200
commit510045b3c554261a0a6434bfe73adac32b12cc81 (patch)
treecc0907d84ec5ad72baed8e0fb6fe7d81176bbb3c /lib
parent8854f230866f458382f6dc207f706220e9c32351 (diff)
parente849de7296efbece490447cdceeed9726f10b33c (diff)
Merge branch 'FreshRSS/dev' into multiuser-token
Diffstat (limited to 'lib')
-rw-r--r--lib/Favicon/Favicon.php14
-rw-r--r--lib/lib_install.php2
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/Favicon/Favicon.php b/lib/Favicon/Favicon.php
index 8571a1b95..85d2ef19b 100644
--- a/lib/Favicon/Favicon.php
+++ b/lib/Favicon/Favicon.php
@@ -179,7 +179,7 @@ class Favicon
// Sometimes people lie, so check the status.
// And sometimes, it's not even an image. Sneaky bastards!
// If cacheDir isn't writable, that's not our problem
- if ($favicon && is_writable($this->cacheDir) && !$this->checkImageMType($favicon)) {
+ if ($favicon && is_writable($this->cacheDir) && extension_loaded('fileinfo') && !$this->checkImageMType($favicon)) {
$favicon = false;
}
@@ -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;
diff --git a/lib/lib_install.php b/lib/lib_install.php
index 76871c98a..c625a670a 100644
--- a/lib/lib_install.php
+++ b/lib/lib_install.php
@@ -67,7 +67,7 @@ function checkRequirements($dbType = '') {
'favicons' => $favicons ? 'ok' : 'ko',
'http_referer' => $http_referer ? 'ok' : 'ko',
'message' => $message ?: 'ok',
- 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $fileinfo && $dom && $xml &&
+ 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && $xml &&
$data && $cache && $users && $favicons && $http_referer && $message == '' ?
'ok' : 'ko'
);