diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index f94f73c57..68235566d 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -407,20 +407,20 @@ function getFilenameByDocname($content) { /* {{{ */ * @return string mimetype */ function getMimeType($filename) { /* {{{ */ - $finfo = finfo_open(FILEINFO_MIME_TYPE); - $mimetype = finfo_file($finfo, $filename); + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mimetype = finfo_file($finfo, $filename); - switch($mimetype) { - case 'application/octet-stream': - case 'text/plain': - $lastDotIndex = strrpos($filename, "."); - if($lastDotIndex === false) $fileType = "."; - else $fileType = substr($name, $lastDotIndex); - if($fileType == '.md') - $mimetype = 'text/markdown'; - break; - } - return $mimetype; + switch($mimetype) { + case 'application/octet-stream': + case 'text/plain': + $lastDotIndex = strrpos($filename, "."); + if($lastDotIndex === false) $fileType = "."; + else $fileType = substr($filename, $lastDotIndex); + if($fileType == '.md') + $mimetype = 'text/markdown'; + break; + } + return $mimetype; } /* }}} */ function getLogger($prefix='', $mask=PEAR_LOG_INFO) { /* {{{ */