aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-10-05 22:01:00 +0200
committerGitHub <noreply@github.com>2020-10-05 22:01:00 +0200
commitfe08f406b2d4459492de664b2d84899da1768014 (patch)
treecfdee6cab4fc40fb0adf59416f319c86e31e71b6 /apps/workflowengine/lib
parent482b42c4a70f2a2cfa30e329405052afbbea3de4 (diff)
parent63479684a562f5795f20db7729592426af2cba05 (diff)
downloadnextcloud-server-fe08f406b2d4459492de664b2d84899da1768014.tar.gz
nextcloud-server-fe08f406b2d4459492de664b2d84899da1768014.zip
Merge pull request #23096 from nextcloud/bugfix/noid/mimetypes2
Also check the path based mimetype for flow rule checks
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php
index 0e02c405126..4e61e5693b9 100644
--- a/apps/workflowengine/lib/Check/FileMimeType.php
+++ b/apps/workflowengine/lib/Check/FileMimeType.php
@@ -94,6 +94,19 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
}
/**
+ * Make sure that even though the content based check returns an application/octet-stream can still be checked based on mimetypemappings of their extension
+ *
+ * @param string $operator
+ * @param string $value
+ * @return bool
+ */
+ public function executeCheck($operator, $value) {
+ $actualValue = $this->getActualValue();
+ return $this->executeStringCheck($operator, $value, $actualValue) ||
+ $this->executeStringCheck($operator, $value, $this->mimeTypeDetector->detectPath($this->path));
+ }
+
+ /**
* @return string
*/
protected function getActualValue() {