Fix : check if is_file in getMimeType#590
Conversation
matks
left a comment
There was a problem hiding this comment.
Hello in order to understand why you added these options, we would need to understand what situation you were in 😉
| $mimeType = mime_content_type($filename); | ||
| } | ||
| if (!$mimeType) { | ||
| $mimeType = trim(exec('file -bi ' . escapeshellarg($filename))); |
There was a problem hiding this comment.
Waaaaah 🤯 I did not know this code performed an exec... it's a bit frightening 😅 for security issues
|
Hello, but all my files is in the right folder. If you check if is a file before get mime type, it's avoid the warning. |
|
Thanks @julienmiclo so if I understand
|
|
According to AdminBlockListingController.php#L178-L201, we can use |
Hello,
on my localhost i have some warning when filename are check with getMimeType function.
I added an if condition around 4 Try with mime type.