mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
4888082cda
|
@ -407,20 +407,20 @@ function getFilenameByDocname($content) { /* {{{ */
|
||||||
* @return string mimetype
|
* @return string mimetype
|
||||||
*/
|
*/
|
||||||
function getMimeType($filename) { /* {{{ */
|
function getMimeType($filename) { /* {{{ */
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$mimetype = finfo_file($finfo, $filename);
|
$mimetype = finfo_file($finfo, $filename);
|
||||||
|
|
||||||
switch($mimetype) {
|
switch($mimetype) {
|
||||||
case 'application/octet-stream':
|
case 'application/octet-stream':
|
||||||
case 'text/plain':
|
case 'text/plain':
|
||||||
$lastDotIndex = strrpos($filename, ".");
|
$lastDotIndex = strrpos($filename, ".");
|
||||||
if($lastDotIndex === false) $fileType = ".";
|
if($lastDotIndex === false) $fileType = ".";
|
||||||
else $fileType = substr($name, $lastDotIndex);
|
else $fileType = substr($filename, $lastDotIndex);
|
||||||
if($fileType == '.md')
|
if($fileType == '.md')
|
||||||
$mimetype = 'text/markdown';
|
$mimetype = 'text/markdown';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $mimetype;
|
return $mimetype;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getLogger($prefix='', $mask=PEAR_LOG_INFO) { /* {{{ */
|
function getLogger($prefix='', $mask=PEAR_LOG_INFO) { /* {{{ */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user