Merge pull request #24518 from nextcloud/backport/24459/stable19
[stable19] Only execute plain mimetype check for directories and do the fallback…
This commit is contained in:
commit
80efa644f6
|
@ -102,8 +102,12 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
|
||||||
*/
|
*/
|
||||||
public function executeCheck($operator, $value) {
|
public function executeCheck($operator, $value) {
|
||||||
$actualValue = $this->getActualValue();
|
$actualValue = $this->getActualValue();
|
||||||
return $this->executeStringCheck($operator, $value, $actualValue) ||
|
$plainMimetypeResult = $this->executeStringCheck($operator, $value, $actualValue);
|
||||||
$this->executeStringCheck($operator, $value, $this->mimeTypeDetector->detectPath($this->path));
|
if ($actualValue === 'httpd/unix-directory') {
|
||||||
|
return $plainMimetypeResult;
|
||||||
|
}
|
||||||
|
$detectMimetypeBasedOnFilenameResult = $this->executeStringCheck($operator, $value, $this->mimeTypeDetector->detectPath($this->path));
|
||||||
|
return $plainMimetypeResult || $detectMimetypeBasedOnFilenameResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue