]> source.dussan.org Git - nextcloud-server.git/commitdiff
Detect mimetype by content only with content 29454/head
authorJoas Schilling <coding@schilljs.com>
Wed, 27 Oct 2021 08:45:03 +0000 (10:45 +0200)
committerJoas Schilling <coding@schilljs.com>
Wed, 27 Oct 2021 08:46:44 +0000 (10:46 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/workflowengine/lib/Check/FileMimeType.php

index 2fa0361f3b48f8d3e2423b36fe2cd4dc75be0786..42b93bd951367e09ce51711c3d5533a5a3670eb2 100644 (file)
@@ -127,7 +127,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);