1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

upload2usb.php: allow all word files, be more specific about xml mimetypes; log error message if user uploads invalid mimetype

This commit is contained in:
avni 2025-01-23 06:51:43 +01:00
parent 68dafdbc39
commit 6dfda009e4

View file

@ -55,9 +55,10 @@ function getFileCount ($folder_path) {
//check if file mimetype is acceptable for upload
function isFileMimeTypeAcceptable ($file) {
$mimetype = strtolower(mime_content_type($file));
$invalid_mimetypes_str = array ("compress", "octet", "xml", "zip");
$invalid_mimetypes_str = array ("compress", "image/svg+xml", "octet", "text/xml", "xhtml+xml", "zip");
foreach ($invalid_mimetypes_str as $invalid_mt_str) {
if (str_contains($mimetype, $invalid_mt_str)) {
error_log('UPLOAD2USB ERROR - MIMETYPE: ' . $mimetype);
return false;
}
}