mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
add acceptable accepted value
the string of '1' is also evaluated to true and a post variable is more likely to be set to a string
This commit is contained in:
parent
39eaf820c1
commit
0156bfc54e
@ -186,7 +186,7 @@ class Validator
|
|||||||
*/
|
*/
|
||||||
protected function validateAccepted($field, $value)
|
protected function validateAccepted($field, $value)
|
||||||
{
|
{
|
||||||
$acceptable = array('yes', 'on', 1, true);
|
$acceptable = array('yes', 'on', 1, '1', true);
|
||||||
|
|
||||||
return $this->validateRequired($field, $value) && in_array($value, $acceptable, true);
|
return $this->validateRequired($field, $value) && in_array($value, $acceptable, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user