mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-31 13:18:06 +00:00 
			
		
		
		
	remove getMimeType(), it has been moved to SeedDMS_Core
This commit is contained in:
		
							parent
							
								
									e719f31167
								
							
						
					
					
						commit
						2c96fb5a1c
					
				|  | @ -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; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann