Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

fix the constructor's type-autodetection accepts wrong parameters #4351

Closed

Conversation

noopable
Copy link
Contributor

$validator = new \Zend\Validator\NotEmpty(array('translatorEnabled' => true));
var_dump($validator->getType());
var_dump($validator->isValid(''));

expects
493
false

but actually
1
true.

because if 'type' is not found in $options, the autodetection compares bool(true) to string(constants), it is true. And autodetector set 'type' true.
So, in_array 's third parameter should be true.

@ghost ghost assigned weierophinney Apr 29, 2013
weierophinney added a commit that referenced this pull request Apr 29, 2013
fix the constructor's type-autodetection accepts wrong parameters
weierophinney added a commit that referenced this pull request Apr 29, 2013
@noopable noopable deleted the patch-validator-notempty branch December 13, 2013 13:07
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
…ch-validator-notempty

fix the constructor's type-autodetection accepts wrong parameters
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants