diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 68235566d..e13394421 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -395,34 +395,6 @@ function getFilenameByDocname($content) { /* {{{ */ return mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $filename); } /* }}} */ -/** - * Return the mimetype of a given file - * - * This functions uses finfo but will correct some mimetypes which are - * not propperly determined or could be more specific, e.g. text/plain - * which is actually text/markdown. In thoses cases - * the file extension will be taken into account. - * - * @param string $filename name of file on disc - * @return string mimetype - */ -function getMimeType($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($filename, $lastDotIndex); - if($fileType == '.md') - $mimetype = 'text/markdown'; - break; - } - return $mimetype; -} /* }}} */ - function getLogger($prefix='', $mask=PEAR_LOG_INFO) { /* {{{ */ global $settings;