get mimetype without encoding which simplifies the code

This commit is contained in:
Uwe Steinmann 2022-11-15 16:07:06 +01:00
parent 581841bc42
commit 08d10d2cc0

View File

@ -658,11 +658,9 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
}
fclose($fp);
$finfo = new finfo(FILEINFO_MIME);
$finfo = new finfo(FILEINFO_MIME_TYPE);
$mimetype = $finfo->file($tmpFile);
$tmp = explode(';', $mimetype);
$mimetype = $tmp[0];
$lastDotIndex = strrpos($name, ".");
if($lastDotIndex === false) $fileType = ".";
else $fileType = substr($name, $lastDotIndex);