]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow to specify apps that somethign is a dir
authorJoas Schilling <coding@schilljs.com>
Thu, 12 Dec 2019 21:19:53 +0000 (22:19 +0100)
committerBackportbot <backportbot-noreply@rullzer.com>
Thu, 12 Dec 2019 22:06:10 +0000 (22:06 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/workflowengine/lib/Check/AbstractStringCheck.php
apps/workflowengine/lib/Check/FileMimeType.php
apps/workflowengine/lib/Check/FileName.php
apps/workflowengine/lib/Check/FileSize.php
apps/workflowengine/lib/Check/FileSystemTags.php
apps/workflowengine/lib/Check/RequestRemoteAddress.php
apps/workflowengine/lib/Check/RequestTime.php
apps/workflowengine/lib/Check/UserGroupMembership.php
lib/public/WorkflowEngine/ICheck.php

index 0fd728e349664d5e67c8da762f8c43ada8528269..8ea987c1e5226f1e41b634b942166fed8e23a078 100644 (file)
@@ -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
        }
 
index b5cbf108b6a51e879d35b8475210588042e08d39..c2a8356901dca02bec893dc04ca44d241e06b262 100644 (file)
@@ -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;
+                       }
                }
        }
 
index f775227f71c0bc15751351cb4b4e9fa532015fef..4cb402f73d92bd0363b21834d36d8d35414b08d8 100644 (file)
@@ -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;
        }
index 7e48f0f603820c84a2b62380c852ac17bc5e9431..76470c73f61f2fec65681bd135905822b60e5909 100644 (file)
@@ -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) {
        }
 
        /**
index 4a2b87fd53ec7b809a353428542e50ba72c9e5c2..1def0d65aadce94fbe1becf761b4e0cae0bcc56c 100644 (file)
@@ -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;
        }
index 6fa4cfc880055393264ab7f0b00d32510674ca39..11b0c6d234daba958f523f7aa5879dff6950c948 100644 (file)
@@ -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.
        }
 
index 2aa79e77673cb993cf181352c56ea7ecc0ea79e4..d596b4d52d5fe765255a49cbdfc590e9db528be8 100644 (file)
@@ -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.
        }
 
index fd6ba00d09245af5a27110fecefcc1fcd8f38842..32f4a2c9f64aa17c6700ed557d5a832e6daf4927 100644 (file)
@@ -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.
        }
 
index 1d4fc9664604858dfb3bc3c0ea24da576efc8510..e5d3f79dbd7cc783df5a07a342c97712e8a2e813 100644 (file)
@@ -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