Skip to content

Commit

Permalink
Improving Constraint_check
Browse files Browse the repository at this point in the history
Validating check always expect string in `$value`. This fix is also accept arrays.
  • Loading branch information
jinjie authored Apr 14, 2022
1 parent ef427b9 commit ba58c8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/ZenValidatorConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,12 @@ public function removeParsley()

public function validate($value)
{
$array = array_filter(explode(',', $value));
if (is_string($value)) {
$array = array_filter(explode(',', $value));
} else {
$array = $value;
}

if (empty($array)) {
return; //you should use required instead
}
Expand Down

0 comments on commit ba58c8b

Please sign in to comment.