]> source.dussan.org Git - nextcloud-server.git/commitdiff
Detect mimetype by content only with content 29458/head
authorJoas Schilling <coding@schilljs.com>
Wed, 27 Oct 2021 08:45:03 +0000 (10:45 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 27 Oct 2021 13:47:31 +0000 (13:47 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/workflowengine/lib/Check/FileMimeType.php

index 8d9e2468ebd84d1dbba10c913970c268340174a0..1beb87d7a15bbe2dceb7873b9d58d0afa4ae4cb9 100644 (file)
@@ -122,7 +122,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
                        return $this->cacheAndReturnMimeType($this->storage->getId(), $this->path, 'httpd/unix-directory');
                }
 
-               if ($this->storage->file_exists($this->path)) {
+               if ($this->storage->file_exists($this->path) && $this->storage->filesize($this->path)) {
                        $path = $this->storage->getLocalFile($this->path);
                        $mimeType = $this->mimeTypeDetector->detectContent($path);
                        return $this->cacheAndReturnMimeType($this->storage->getId(), $this->path, $mimeType);