summaryrefslogtreecommitdiff
path: root/inc/confutils.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/confutils.php')
-rw-r--r--inc/confutils.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/inc/confutils.php b/inc/confutils.php
index a7799b9d4..1ef0942f8 100644
--- a/inc/confutils.php
+++ b/inc/confutils.php
@@ -14,7 +14,7 @@
* @author Andreas Gohr <andi@splitbrain.org>
*/
function mimetype($file){
- $ret = array(false,false); // return array
+ $ret = array(false,false,false); // return array
$mtypes = getMimeTypes(); // known mimetypes
$exts = join('|',array_keys($mtypes)); // known extensions (regexp)
if(preg_match('#\.('.$exts.')$#i',$file,$matches)){
@@ -22,7 +22,11 @@ function mimetype($file){
}
if($ext && $mtypes[$ext]){
- $ret = array($ext, $mtypes[$ext]);
+ if($mtypes[$ext][0] == '!'){
+ $ret = array($ext, substr($mtypes[$ext],1), true);
+ }else{
+ $ret = array($ext, $mtypes[$ext], false);
+ }
}
return $ret;