diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-11-30 16:43:55 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-11-30 16:43:57 +0100 |
commit | c44ec8c5d584cf16b68c6c2d92ac2b1e4f39f912 (patch) | |
tree | 625b44c5a974d0ccf4b4dace34a8bad94f0262c5 /apps/workflowengine | |
parent | 3a8bd38ca414cd50ff690722f8bbaaace43a341e (diff) | |
download | nextcloud-server-c44ec8c5d584cf16b68c6c2d92ac2b1e4f39f912.tar.gz nextcloud-server-c44ec8c5d584cf16b68c6c2d92ac2b1e4f39f912.zip |
Only execute plain mimetype check for directories and do the fallback only for non-directories
Ref #23096
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r-- | apps/workflowengine/lib/Check/FileMimeType.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index 4e61e5693b9..8d9e2468ebd 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -102,8 +102,12 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck { */ 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; } /** |