From 4e94e60934ebae113d143a9765a784dc4b162f22 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 3 Apr 2016 15:32:00 -0500 Subject: [PATCH] Issue 149: Resources uploaded with extensions with capital letters have wrong mime type --- indefero/src/IDF/FileUtil.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indefero/src/IDF/FileUtil.php b/indefero/src/IDF/FileUtil.php index 42b359c..63f0163 100644 --- a/indefero/src/IDF/FileUtil.php +++ b/indefero/src/IDF/FileUtil.php @@ -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']); } }