From c6cff0ff061d9c82d754c55a0c63c90bbf56d174 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 27 Oct 2021 10:45:03 +0200 Subject: [PATCH] Detect mimetype by content only with content Signed-off-by: Joas Schilling --- apps/workflowengine/lib/Check/FileMimeType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index 8d9e2468ebd84..1beb87d7a15bb 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -122,7 +122,7 @@ protected function getActualValue() { 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);