Skip to content
Snippets Groups Projects
Unverified Commit e7ad0448 authored by Julius Härtl's avatar Julius Härtl
Browse files

Validate check array in the backend


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent dca861de
No related branches found
No related tags found
No related merge requests found
......@@ -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']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment