allow to set mimetype if is possibly wrong

This commit is contained in:
Uwe Steinmann 2022-11-15 16:05:53 +01:00
parent f52e950283
commit 2e0c369b25

View File

@ -345,9 +345,10 @@ $(document).ready( function() {
print "<li>".htmlspecialchars($file->getName())."</li>\n";
if($file->getName() != $file->getOriginalFileName())
print "<li>".htmlspecialchars($file->getOriginalFileName())."</li>\n";
if ($file_exists)
if ($file_exists) {
$realmimetype = getMimeType($dms->contentDir . $file->getPath());
print "<li>".SeedDMS_Core_File::format_filesize(filesize($dms->contentDir . $file->getPath())) ." bytes, ".htmlspecialchars($file->getMimeType())."</li>";
else print "<li>".htmlspecialchars($file->getMimeType())." - <span class=\"warning\">".getMLText("document_deleted")."</span></li>";
} else print "<li>".htmlspecialchars($file->getMimeType())." - <span class=\"warning\">".getMLText("document_deleted")."</span></li>";
print "<li>".getMLText("uploaded_by")." <a href=\"mailto:".htmlspecialchars($responsibleUser->getEmail())."\">".htmlspecialchars($responsibleUser->getFullName())."</a></li>";
print "<li>".getLongReadableDate($file->getDate())."</li>";
@ -736,6 +737,11 @@ $(document).ready( function() {
if ($file_exists) {
print "<li>". SeedDMS_Core_File::format_filesize($latestContent->getFileSize()) .", ";
print htmlspecialchars($latestContent->getMimeType());
if($user->isAdmin()) {
$realmimetype = getMimeType($dms->contentDir . $latestContent->getPath());
if($realmimetype != $latestContent->getMimeType())
echo " <i class=\"fa fa-exclamation-triangle ajax-click\" data-param1=\"command=setmimetype\" data-param2=\"contentid=".$latestContent->getId()."\" data-param3=\"formtoken=".createFormKey('setmimetype')."\" title=\"".htmlspecialchars($realmimetype)."\"></i> ";
}
if(in_array($latestContent->getMimeType(), ['image/jpeg', 'image/jpg', 'image/png', 'image/bmp'])) {
$imsize = getimagesize($dms->contentDir . $latestContent->getPath(), $moreinfo);
if(!empty($moreinfo['APP13'])) {