Merge pull request #17296 from nextcloud/backport/17286/stable16

[stable16] Correctly detect the mimetype from uploads
This commit is contained in:
Roeland Jago Douma 2019-09-30 17:11:15 +02:00 committed by GitHub
commit d4f3bfb4cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,7 +113,7 @@ class FileMimeType extends AbstractStringCheck {
$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) {