From 1181058d18f8417f46b62984466f071d6152baa4 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 30 Nov 2020 16:43:55 +0100 Subject: [PATCH] Only execute plain mimetype check for directories and do the fallback only for non-directories Ref #23096 Signed-off-by: Morris Jobke --- apps/workflowengine/lib/Check/FileMimeType.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index 4e61e5693b911..8d9e2468ebd84 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -102,8 +102,12 @@ protected function cacheAndReturnMimeType(string $storageId, ?string $path, stri */ public function executeCheck($operator, $value) { $actualValue = $this->getActualValue(); - return $this->executeStringCheck($operator, $value, $actualValue) || - $this->executeStringCheck($operator, $value, $this->mimeTypeDetector->detectPath($this->path)); + $plainMimetypeResult = $this->executeStringCheck($operator, $value, $actualValue); + if ($actualValue === 'httpd/unix-directory') { + return $plainMimetypeResult; + } + $detectMimetypeBasedOnFilenameResult = $this->executeStringCheck($operator, $value, $this->mimeTypeDetector->detectPath($this->path)); + return $plainMimetypeResult || $detectMimetypeBasedOnFilenameResult; } /**