fix: event validator

This commit is contained in:
Torsten Dittmann committed 2022-05-08 16:31:32 +02:00
1 parent 2cc2a40377
commit 95317d87b8
2 files changed
+10 -5

No files matched your search

+8 -5
View File
@@ -87,11 +87,14 @@ class Event extends Validator
}
if ($attribute ?? false) {
if (
!\array_key_exists($attribute, $events[$type][$action]) ||
(($subType ?? false) && !\array_key_exists($attribute, $events[$type][$subType][$action]))
) {
return false;
if (($subType ?? false)) {
if (!\array_key_exists($attribute, $events[$type][$subType][$action])) {
return false;
}
} else {
if (!\array_key_exists($attribute, $events[$type][$action])) {
return false;
}
}
}