diff --git a/system/validator.php b/system/validator.php index 159de8f2..8ab618f0 100644 --- a/system/validator.php +++ b/system/validator.php @@ -137,7 +137,17 @@ protected function check($attribute, $rule) */ protected function validate_required($attribute) { - return array_key_exists($attribute, $this->attributes) and trim($this->attributes[$attribute]) !== ''; + if ( ! array_key_exists($attribute, $this->attributes)) + { + return false; + } + + if (is_string($this->attributes[$attribute]) and trim($this->attributes[$attribute]) === '') + { + return false; + } + + return true; } /**