Skip to content


Zend\Validator\Explode does not handle NULL #2726

pdobrigkeit opened this Issue · 1 comment

3 participants


I have a Zend\Form\Input\Select which is configured with a Null Filter and the default Validators (which seem to have changed recently, adding by default the Explode Validator)

Now if I submit an empty value (empty array or missing value altogether) the filter correctly translates this to a NULL, which in turn is put into the explode validator, that now fails.

What should be the desired behaviour here?
a) Should the Explode Validator be able to handle NULL values and skip validation.
b) Should the Explode Validator be configurable to accept NULL, but how would the Select Element have to change for this?
c) Is this just a configuration problem that should be avoided (if yes, than how?)


@pdobrigkeit my vote would be option A, but without skipping validation. I think the Explode validator should get out of the way (in terms of type checking) and just proxy to it's bound validators (See referenced PR #3527).

This would allow for Select and MultiCheckbox input filters to pass the filtered NULL values through the Explode validator to the InArray validator. The user would just need to ensure that NULL is a value in the InArray haystack.

@ghost Unknown pushed a commit that referenced this issue
@weierophinney weierophinney Merge branch 'hotfix/3527'
Close #3527
Fixes #2726
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this issue
@weierophinney weierophinney Merge branch 'hotfix/3527' 4d7bf37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.