]> source.dussan.org Git - nextcloud-server.git/commitdiff
Validate check array in the backend
authorJulius Härtl <jus@bitgrid.net>
Mon, 23 Dec 2019 10:57:41 +0000 (11:57 +0100)
committerJulius Härtl <jus@bitgrid.net>
Fri, 27 Dec 2019 07:45:39 +0000 (08:45 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/workflowengine/lib/Manager.php

index bd71e7bb3c623490906f6d22569d5efbad3ade1a..7e447a38a01706990c08e2ad76e3909bbf007b5c 100644 (file)
@@ -467,9 +467,16 @@ class Manager implements IManager {
 
                $this->validateEvents($entity, $events, $instance);
 
+               if (count($checks) === 0) {
+                       throw new \UnexpectedValueException($this->l->t('At least one check needs to be provided'));
+               }
                $instance->validateOperation($name, $checks, $operation);
 
                foreach ($checks as $check) {
+                       if (!is_string($check['class'])) {
+                               throw new \UnexpectedValueException($this->l->t('Invalid check provided'));
+                       }
+
                        try {
                                /** @var ICheck $instance */
                                $instance = $this->container->query($check['class']);