summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib/Manager.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-12-23 11:57:41 +0100
committerJulius Härtl <jus@bitgrid.net>2019-12-27 08:45:39 +0100
commite7ad0448261a6706053749ea7eaf4c34ddef17ef (patch)
treead61466c88f9cb9d304aba3e1b59d29a0c759a45 /apps/workflowengine/lib/Manager.php
parentdca861de942282d8536d52a785ae464237bd0d81 (diff)
downloadnextcloud-server-e7ad0448261a6706053749ea7eaf4c34ddef17ef.tar.gz
nextcloud-server-e7ad0448261a6706053749ea7eaf4c34ddef17ef.zip
Validate check array in the backend
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/workflowengine/lib/Manager.php')
-rw-r--r--apps/workflowengine/lib/Manager.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php
index bd71e7bb3c6..7e447a38a01 100644
--- a/apps/workflowengine/lib/Manager.php
+++ b/apps/workflowengine/lib/Manager.php
@@ -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']);