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:
Matthew Laver 2016-03-11 10:31:07 +00:00
parent 39eaf820c1
commit 0156bfc54e

View File

@ -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);
} }