Issue 149: Resources uploaded with extensions with capital letters have wrong mime type

master
Nathan Adams 2016-04-03 15:32:00 -05:00
parent 86c15a38d9
commit 4e94e60934
1 changed files with 2 additions and 1 deletions

View File

@ -128,10 +128,11 @@ class IDF_FileUtil
$info = pathinfo($file);
if (isset($info['extension'])) {
$extension = strtolower($info["extension"]);
foreach ($mimes as $mime) {
if ('#' != substr($mime, 0, 1)) {
$elts = preg_split('/ |\t/', $mime, -1, PREG_SPLIT_NO_EMPTY);
if (in_array($info['extension'], $elts)) {
if (in_array($extension, $elts)) {
return array($elts[0], $info['basename'], $info['extension']);
}
}