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:
parent
68dafdbc39
commit
6dfda009e4
1 changed files with 2 additions and 1 deletions
|
@ -55,9 +55,10 @@ function getFileCount ($folder_path) {
|
||||||
//check if file mimetype is acceptable for upload
|
//check if file mimetype is acceptable for upload
|
||||||
function isFileMimeTypeAcceptable ($file) {
|
function isFileMimeTypeAcceptable ($file) {
|
||||||
$mimetype = strtolower(mime_content_type($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) {
|
foreach ($invalid_mimetypes_str as $invalid_mt_str) {
|
||||||
if (str_contains($mimetype, $invalid_mt_str)) {
|
if (str_contains($mimetype, $invalid_mt_str)) {
|
||||||
|
error_log('UPLOAD2USB ERROR - MIMETYPE: ' . $mimetype);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue