Validate check array in the backend
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
dca861de94
commit
e7ad044826
|
@ -467,9 +467,16 @@ class Manager implements IManager {
|
||||||
|
|
||||||
$this->validateEvents($entity, $events, $instance);
|
$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);
|
$instance->validateOperation($name, $checks, $operation);
|
||||||
|
|
||||||
foreach ($checks as $check) {
|
foreach ($checks as $check) {
|
||||||
|
if (!is_string($check['class'])) {
|
||||||
|
throw new \UnexpectedValueException($this->l->t('Invalid check provided'));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/** @var ICheck $instance */
|
/** @var ICheck $instance */
|
||||||
$instance = $this->container->query($check['class']);
|
$instance = $this->container->query($check['class']);
|
||||||
|
|
Loading…
Reference in New Issue