diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-13 11:21:45 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-13 11:21:45 +0000 |
| commit | 98263b317367b45ae491aa1836e0b2dca49f97bb (patch) | |
| tree | b2205b1ae461042886fb4346f64c10c0dd158c18 /roundcubemail/program/include/main.inc | |
| parent | c39d008ec66c5c528f63f760083f7c6d253395db (diff) | |
- Make mime type detection based on filename extension to be case-insensitive
git-svn-id: https://svn.roundcube.net/trunk@5769 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/main.inc')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index 148c2bd5c..9f154e4b7 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/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)); } /** |
