fix creating preview image of file in drop folder if it contains special chars

This commit is contained in:
Uwe Steinmann 2023-10-12 13:34:46 +02:00
parent 5843db1451
commit ab82a65bcc
2 changed files with 5 additions and 3 deletions

View File

@ -5,6 +5,8 @@
file with drag&drop
- user images may be 300px height, do not scale them up
- do not show unreadable documents on Dashboard
- fix creating preview image of file in drop folder if it contains
special chars
--------------------------------------------------------------------------------
Changes in version 5.1.32

View File

@ -89,10 +89,10 @@ $('.folderselect').click(function(ev) {
if($previewwidth) {
$previewer->createRawPreview($dir.DIRECTORY_SEPARATOR.$entry, 'dropfolder'.DIRECTORY_SEPARATOR, $mimetype);
if($previewer->hasRawPreview($dir.DIRECTORY_SEPARATOR.$entry, 'dropfolder'.DIRECTORY_SEPARATOR)) {
$subitem['label'] .= "<div class=\"dropfolder-menu-img\" style=\"display: none; overflow:hidden; position: absolute; left:-".($previewwidth+10)."px; border: 1px solid #888;background: white;\"><img filename=\"".$entry."\" width=\"".$previewwidth."\" src=\"".$settings->_httpRoot."op/op.DropFolderPreview.php?filename=".$entry."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\"></div>";
$subitem['label'] .= "<div class=\"dropfolder-menu-img\" style=\"display: none; overflow:hidden; position: absolute; left:-".($previewwidth+10)."px; border: 1px solid #888;background: white;\"><img filename=\"".htmlspecialchars($entry)."\" width=\"".$previewwidth."\" src=\"".$settings->_httpRoot."op/op.DropFolderPreview.php?filename=".urlencode($entry)."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\"></div>";
}
}
$subitem['label'] .= "<div class=\"dropfolder-menu-text\" style=\"margin-left:10px; margin-right: 10px; display:inline-block;\">".$entry."<br /><span style=\"font-size: 85%;\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry)).", ".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</span></div>";
$subitem['label'] .= "<div class=\"dropfolder-menu-text\" style=\"margin-left:10px; margin-right: 10px; display:inline-block;\">".htmlspecialchars($entry)."<br /><span style=\"font-size: 85%;\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry)).", ".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</span></div>";
$menuitems['dropfolder']['children'][] = $subitem;
} elseif($showfolders && is_dir($dir.'/'.$entry)) {
$subitem = array('label'=>$entry);
@ -148,7 +148,7 @@ $('.folderselect').click(function(ev) {
$previewer->createRawPreview($dir.'/'.$entry, 'dropfolder/', $mimetype);
echo "<tr><td style=\"min-width: ".$previewwidth."px;\">";
if($previewer->hasRawPreview($dir.'/'.$entry, 'dropfolder/')) {
echo "<img style=\"cursor: pointer;\" class=\"fileselect mimeicon\" data-filename=\"".$entry."\" data-form=\"".$form."\" width=\"".$previewwidth."\" src=\"../op/op.DropFolderPreview.php?filename=".$entry."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\">";
echo "<img style=\"cursor: pointer;\" class=\"fileselect mimeicon\" data-filename=\"".htmlspecialchars($entry)."\" data-form=\"".$form."\" width=\"".$previewwidth."\" src=\"../op/op.DropFolderPreview.php?filename=".urlencode($entry)."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\">";
}
echo "</td><td><span style=\"cursor: pointer;\" class=\"fileselect\" data-filename=\"".$entry."\" data-form=\"".$form."\">".$entry."</span></td><td align=\"right\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry))."</td><td>".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</td></tr>\n";
} elseif($showfolders && is_dir($dir.'/'.$entry)) {