summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-01-13 11:21:45 +0000
committeralecpl <alec@alec.pl>2012-01-13 11:21:45 +0000
commit4391a7809edae1b552f0720a43924212519900a9 (patch)
treec14ef87917408c1176a202a4551b609b58b96f78 /program/include/main.inc
parentfd43a92b5d31bab019d9afec1c9846b7ab9291bb (diff)
- Make mime type detection based on filename extension to be case-insensitive
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 148c2bd5c..9f154e4b7 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1627,12 +1627,14 @@ function rcmail_filetype2classname($mimetype, $filename)
list($primary, $secondary) = explode('/', $mimetype);
$classes = array($primary ? $primary : 'unknown');
- if ($secondary)
+ if ($secondary) {
$classes[] = $secondary;
- if (preg_match('/\.([a-z0-9]+)$/', $filename, $m))
+ }
+ if (preg_match('/\.([a-z0-9]+)$/i', $filename, $m)) {
$classes[] = $m[1];
+ }
- return join(" ", $classes);
+ return strtolower(join(" ", $classes));
}
/**