diff options
author | alecpl <alec@alec.pl> | 2008-07-18 11:38:56 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-07-18 11:38:56 +0000 |
commit | 403e3f4b223e71e4797dbf948b578fc6d14b7c2e (patch) | |
tree | f41833110572c4b048f7848ec41f241ddca60f10 /program/include | |
parent | b82a626882a85942c64459d530f0582d33e08499 (diff) |
- use fallback if mime_content_type() returns false (#1485222)
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_shared.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index 801dac7fe..4cab27096 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -561,13 +561,17 @@ function rc_mime_content_type($path, $failover = 'unknown/unknown') $mime_magic = $CONFIG['mime_magic']; if (function_exists('mime_content_type')) { - return mime_content_type($path); + $finfo = mime_content_type($path); + if ($finfo) + return $finfo; } + if (!extension_loaded('fileinfo')) { if (!dl('fileinfo.' . PHP_SHLIB_SUFFIX)) { return $failover; } } + $finfo = finfo_open(FILEINFO_MIME, $mime_magic); if (!$finfo) { return $failover; |