diff options
author | Joas Schilling <coding@schilljs.com> | 2021-10-27 10:45:03 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-27 10:46:44 +0200 |
commit | 7a6d559f19bf68b280375be4086043b69051b72b (patch) | |
tree | 22fa77ac0718692705e5f39de37e41ce45aab40a | |
parent | d231d2618de78b87cbc3916109652f0432fee607 (diff) | |
download | nextcloud-server-7a6d559f19bf68b280375be4086043b69051b72b.tar.gz nextcloud-server-7a6d559f19bf68b280375be4086043b69051b72b.zip |
Detect mimetype by content only with content
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | apps/workflowengine/lib/Check/FileMimeType.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index 2fa0361f3b4..42b93bd9513 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -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); |