Support files with names like foo.0.1.3.ogg

This commit is contained in:
ken restivo 2015-10-27 19:48:14 -07:00
parent 65587be737
commit b3528c314a

View File

@ -108,9 +108,9 @@ function z_mime_content_type($filename) {
'oth' => 'application/vnd.oasis.opendocument.text-web'
);
$dot = strpos($filename, '.');
if ($dot !== false) {
$ext = strtolower(substr($filename, $dot + 1));
$last_dot = strrpos($filename, '.');
if ($last_dot !== false) {
$ext = strtolower(substr($filename, $last_dot + 1));
if (array_key_exists($ext, $mime_types)) {
return $mime_types[$ext];
}