Commit e9a43326 by Taylor Otwell

fix bug in validator class required check.

parent 49cd851f
...@@ -137,7 +137,17 @@ class Validator { ...@@ -137,7 +137,17 @@ class Validator {
*/ */
protected function validate_required($attribute) 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;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment