- use fallback if mime_content_type() returns false (#1485222)

release-0.6
alecpl 16 years ago
parent b82a626882
commit 403e3f4b22

@ -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;

Loading…
Cancel
Save