Correctly detect the mimetype from uploads

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-09-26 17:43:47 +02:00
parent cc6874df19
commit 744b635d5c
No known key found for this signature in database
GPG key ID: 7076EA9751AACDDA

View file

@ -111,7 +111,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
$files = $this->request->getUploadedFile('files');
if (isset($files['type'][0])) {
$mimeType = $files['type'][0];
if ($this->mimeType === 'application/octet-stream') {
if ($mimeType === 'application/octet-stream') {
// Maybe not...
$mimeTypeTest = $this->mimeTypeDetector->detectPath($files['name'][0]);
if ($mimeTypeTest !== 'application/octet-stream' && $mimeTypeTest !== false) {