Skip to content

Commit

Permalink
Only execute plain mimetype check for directories and do the fallback…
Browse files Browse the repository at this point in the history
… only for non-directories

Ref #23096

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
  • Loading branch information
MorrisJobke authored and backportbot[bot] committed Dec 2, 2020
1 parent 54ab2b9 commit 1181058
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/workflowengine/lib/Check/FileMimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 1181058

Please sign in to comment.