Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Validate check array in the backend
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Dec 27, 2019
commit e7ad0448261a6706053749ea7eaf4c34ddef17ef
7 changes: 7 additions & 0 deletions apps/workflowengine/lib/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,16 @@ public function validateOperation($class, $name, array $checks, $operation, stri

$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']);
Expand Down