mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
find a better mimetype by using file() and the extension
This commit is contained in:
parent
5438d95eb5
commit
b9311ff1e7
|
@ -663,14 +663,17 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
|
||||
$tmp = explode(';', $mimetype);
|
||||
$mimetype = $tmp[0];
|
||||
$lastDotIndex = strrpos($name, ".");
|
||||
if($lastDotIndex === false) $fileType = ".";
|
||||
else $fileType = substr($name, $lastDotIndex);
|
||||
switch($mimetype) {
|
||||
case 'application/pdf';
|
||||
case 'application/pdf':
|
||||
$fileType = ".pdf";
|
||||
break;
|
||||
default:
|
||||
$lastDotIndex = strrpos($name, ".");
|
||||
if($lastDotIndex === false) $fileType = ".";
|
||||
else $fileType = substr($name, $lastDotIndex);
|
||||
case 'text/plain':
|
||||
if($fileType == '.md')
|
||||
$mimetype = 'text/markdown';
|
||||
break;
|
||||
}
|
||||
if($this->logger)
|
||||
$this->logger->log('PUT: file is of type '.$mimetype, PEAR_LOG_INFO);
|
||||
|
@ -698,7 +701,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
unlink($tmpFile);
|
||||
return "403 Forbidden";
|
||||
} else {
|
||||
/* Check if the new version iѕ identical to the current version.
|
||||
/* Check if the new version is identical to the current version.
|
||||
* In that case just update the modification date
|
||||
*/
|
||||
$lc = $document->getLatestContent();
|
||||
|
|
Loading…
Reference in New Issue
Block a user