From 0156bfc54e26718eb8579b0166874d7535e2aef6 Mon Sep 17 00:00:00 2001 From: Matthew Laver Date: Fri, 11 Mar 2016 10:31:07 +0000 Subject: [PATCH] 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 --- src/Valitron/Validator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index c6bafd7..90a9aa1 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -186,7 +186,7 @@ class Validator */ 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); }