Skip to content

Commit

Permalink
Add type check before validating URL (#17504)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathielo authored and taylorotwell committed Jan 24, 2017
1 parent 55843b7 commit 052e9a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,10 @@ protected function validateTimezone($attribute, $value)
*/
protected function validateUrl($attribute, $value)
{
if (! is_string($value)) {
return false;
}

/*
* This pattern is derived from Symfony\Component\Validator\Constraints\UrlValidator (2.7.4).
*
Expand Down

0 comments on commit 052e9a5

Please sign in to comment.