Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Only execute plain mimetype check for directories and do the fallback…
… only for non-directories

Ref #23096

Signed-off-by: Morris Jobke <[email protected]>
  • Loading branch information
MorrisJobke authored and backportbot[bot] committed Dec 2, 2020
commit a305573abd79e38ba7337549369b5c21f1ff91ab
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