Skip to content

Commit 9e3bdcd

Browse files
juliusknorrbackportbot[bot]
authored andcommitted
Make sure to check the mimetype on the path if a secure one could not be detemined though the content
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 85e5e71 commit 9e3bdcd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

apps/workflowengine/lib/Check/FileMimeType.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ protected function cacheAndReturnMimeType(string $storageId, ?string $path, stri
9393
return $mimeType;
9494
}
9595

96+
/**
97+
* Make sure that even though the content based check returns an application/octet-stream can still be checked based on mimetypemappings of their extension
98+
*
99+
* @param string $operator
100+
* @param string $value
101+
* @return bool
102+
*/
103+
public function executeCheck($operator, $value) {
104+
$actualValue = $this->getActualValue();
105+
return $this->executeStringCheck($operator, $value, $actualValue) ||
106+
$this->executeStringCheck($operator, $value, $this->mimeTypeDetector->detectPath($this->path));
107+
}
108+
96109
/**
97110
* @return string
98111
*/

0 commit comments

Comments
 (0)