Skip to content

Commit 759f47c

Browse files
authored
Merge pull request #23212 from nextcloud/backport/23096/stable19
[stable19] Also check the path based mimetype for flow rule checks
2 parents 60cb077 + 9e3bdcd commit 759f47c

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)