aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib/Check
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-11-29 12:04:34 +0100
committerJoas Schilling <coding@schilljs.com>2019-12-10 09:11:43 +0100
commit4a151c545a6f255f8d8e293cbd673fadc518391e (patch)
tree16ed8261d05b15c24d44cabac1b9365c82b0d465 /apps/workflowengine/lib/Check
parent511a4ba66fdf27f7ab48c37fd3faf12b4f2ef089 (diff)
downloadnextcloud-server-4a151c545a6f255f8d8e293cbd673fadc518391e.tar.gz
nextcloud-server-4a151c545a6f255f8d8e293cbd673fadc518391e.zip
Allow to specify apps that somethign is a dir
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/workflowengine/lib/Check')
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php12
-rw-r--r--apps/workflowengine/lib/Check/TFileCheck.php7
2 files changed, 15 insertions, 4 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php
index 25c4ed28b47..77463d8960a 100644
--- a/apps/workflowengine/lib/Check/FileMimeType.php
+++ b/apps/workflowengine/lib/Check/FileMimeType.php
@@ -57,12 +57,18 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
/**
* @param IStorage $storage
* @param string $path
+ * @param bool $isDir
*/
- public function setFileInfo(IStorage $storage, string $path) {
- $this->_setFileInfo($storage, $path);
+ public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void {
+ $this->_setFileInfo($storage, $path, $isDir);
if (!isset($this->mimeType[$this->storage->getId()][$this->path])
|| $this->mimeType[$this->storage->getId()][$this->path] === '') {
- $this->mimeType[$this->storage->getId()][$this->path] = null;
+
+ if ($isDir) {
+ $this->mimeType[$this->storage->getId()][$this->path] = 'httpd/unix-directory';
+ } else {
+ $this->mimeType[$this->storage->getId()][$this->path] = null;
+ }
}
}
diff --git a/apps/workflowengine/lib/Check/TFileCheck.php b/apps/workflowengine/lib/Check/TFileCheck.php
index 383c2d4ef5f..afaf46b52bf 100644
--- a/apps/workflowengine/lib/Check/TFileCheck.php
+++ b/apps/workflowengine/lib/Check/TFileCheck.php
@@ -37,14 +37,19 @@ trait TFileCheck {
/** @var string */
protected $path;
+ /** @var bool */
+ protected $isDir;
+
/**
* @param IStorage $storage
* @param string $path
+ * @param bool $isDir
* @since 18.0.0
*/
- public function setFileInfo(IStorage $storage, string $path) {
+ public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void {
$this->storage = $storage;
$this->path = $path;
+ $this->isDir = $isDir;
}
/**