diff options
author | Joas Schilling <coding@schilljs.com> | 2019-12-12 22:19:53 +0100 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-12-12 22:06:10 +0000 |
commit | 18975b3e1dd50c3dc701beeba54cce4a9ed5ca7a (patch) | |
tree | 82ad786bde275d9a673be26a483fdd11966ebc85 | |
parent | 290b4f2ece5f2744d698716518a07140dfe23e47 (diff) | |
download | nextcloud-server-18975b3e1dd50c3dc701beeba54cce4a9ed5ca7a.tar.gz nextcloud-server-18975b3e1dd50c3dc701beeba54cce4a9ed5ca7a.zip |
Allow to specify apps that somethign is a dir
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | apps/workflowengine/lib/Check/AbstractStringCheck.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileMimeType.php | 10 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileName.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileSize.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileSystemTags.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/RequestRemoteAddress.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/RequestTime.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/UserGroupMembership.php | 3 | ||||
-rw-r--r-- | lib/public/WorkflowEngine/ICheck.php | 3 |
9 files changed, 24 insertions, 10 deletions
diff --git a/apps/workflowengine/lib/Check/AbstractStringCheck.php b/apps/workflowengine/lib/Check/AbstractStringCheck.php index 0fd728e3496..8ea987c1e52 100644 --- a/apps/workflowengine/lib/Check/AbstractStringCheck.php +++ b/apps/workflowengine/lib/Check/AbstractStringCheck.php @@ -44,8 +44,9 @@ abstract class AbstractStringCheck implements ICheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { // Nothing changes here with a different path } diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index b5cbf108b6a..c2a8356901d 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -58,13 +58,19 @@ class FileMimeType extends AbstractStringCheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { $this->storage = $storage; $this->path = $path; 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/FileName.php b/apps/workflowengine/lib/Check/FileName.php index f775227f71c..4cb402f73d9 100644 --- a/apps/workflowengine/lib/Check/FileName.php +++ b/apps/workflowengine/lib/Check/FileName.php @@ -49,8 +49,9 @@ class FileName extends AbstractStringCheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { $this->storage = $storage; $this->path = $path; } diff --git a/apps/workflowengine/lib/Check/FileSize.php b/apps/workflowengine/lib/Check/FileSize.php index 7e48f0f6038..76470c73f61 100644 --- a/apps/workflowengine/lib/Check/FileSize.php +++ b/apps/workflowengine/lib/Check/FileSize.php @@ -51,8 +51,9 @@ class FileSize implements ICheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { } /** diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index 4a2b87fd53e..1def0d65aad 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -68,8 +68,9 @@ class FileSystemTags implements ICheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { $this->storage = $storage; $this->path = $path; } diff --git a/apps/workflowengine/lib/Check/RequestRemoteAddress.php b/apps/workflowengine/lib/Check/RequestRemoteAddress.php index 6fa4cfc8800..11b0c6d234d 100644 --- a/apps/workflowengine/lib/Check/RequestRemoteAddress.php +++ b/apps/workflowengine/lib/Check/RequestRemoteAddress.php @@ -47,8 +47,9 @@ class RequestRemoteAddress implements ICheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { // A different path doesn't change time, so nothing to do here. } diff --git a/apps/workflowengine/lib/Check/RequestTime.php b/apps/workflowengine/lib/Check/RequestTime.php index 2aa79e77673..d596b4d52d5 100644 --- a/apps/workflowengine/lib/Check/RequestTime.php +++ b/apps/workflowengine/lib/Check/RequestTime.php @@ -52,8 +52,9 @@ class RequestTime implements ICheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { // A different path doesn't change time, so nothing to do here. } diff --git a/apps/workflowengine/lib/Check/UserGroupMembership.php b/apps/workflowengine/lib/Check/UserGroupMembership.php index fd6ba00d092..32f4a2c9f64 100644 --- a/apps/workflowengine/lib/Check/UserGroupMembership.php +++ b/apps/workflowengine/lib/Check/UserGroupMembership.php @@ -60,8 +60,9 @@ class UserGroupMembership implements ICheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir */ - public function setFileInfo(IStorage $storage, $path) { + public function setFileInfo(IStorage $storage, $path, $isDir = false) { // A different path doesn't change group memberships, so nothing to do here. } diff --git a/lib/public/WorkflowEngine/ICheck.php b/lib/public/WorkflowEngine/ICheck.php index 1d4fc966460..e5d3f79dbd7 100644 --- a/lib/public/WorkflowEngine/ICheck.php +++ b/lib/public/WorkflowEngine/ICheck.php @@ -36,9 +36,10 @@ interface ICheck { /** * @param IStorage $storage * @param string $path + * @param bool $isDir * @since 9.1 */ - public function setFileInfo(IStorage $storage, $path); + public function setFileInfo(IStorage $storage, $path, $isDir = false); /** * @param string $operator |