Skip to content
Snippets Groups Projects
Unverified Commit c44ec8c5 authored by Morris Jobke's avatar Morris Jobke
Browse files

Only execute plain mimetype check for directories and do the fallback only for non-directories


Ref #23096

Signed-off-by: default avatarMorris Jobke <hey@morrisjobke.de>
parent 3a8bd38c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment