Skip to content

Commit

Permalink
Merge pull request #24518 from nextcloud/backport/24459/stable19
Browse files Browse the repository at this point in the history
[stable19] Only execute plain mimetype check for directories and do the fallback…
  • Loading branch information
MorrisJobke authored Dec 3, 2020
2 parents c4d29cc + a305573 commit 80efa64
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 80efa64

Please sign in to comment.