summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-10-27 10:45:03 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-10-27 13:47:35 +0000
commit7fe95c55769e7d8c6028d0cd1b057fd6bdaecb96 (patch)
tree437f866bb0cb6d10cfb4e14ed5d40f3a4d004978 /apps/workflowengine
parentf08f41014021e319256d11ab5d556af57b6149f9 (diff)
downloadnextcloud-server-7fe95c55769e7d8c6028d0cd1b057fd6bdaecb96.tar.gz
nextcloud-server-7fe95c55769e7d8c6028d0cd1b057fd6bdaecb96.zip
Detect mimetype by content only with content
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php2
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);