diff options
author | Joas Schilling <coding@schilljs.com> | 2019-12-13 00:19:53 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-12-13 00:23:18 +0300 |
commit | 790de0acefafb63a137e8d53514a32e0d20f6f17 (patch) | |
tree | 9a4dfc25e1514626fba3950e3c3d0e7c19c0e9d5 | |
parent | 6955841c8256121303ae658166e8df2924957af1 (diff) |
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 0a2f33dd626..b3955fbd38b 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 |