Skip to content

Commit 052e9a5

Browse files
mathielotaylorotwell
authored andcommitted
Add type check before validating URL (#17504)
1 parent 55843b7 commit 052e9a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,10 @@ protected function validateTimezone($attribute, $value)
12901290
*/
12911291
protected function validateUrl($attribute, $value)
12921292
{
1293+
if (! is_string($value)) {
1294+
return false;
1295+
}
1296+
12931297
/*
12941298
* This pattern is derived from Symfony\Component\Validator\Constraints\UrlValidator (2.7.4).
12951299
*

0 commit comments

Comments
 (0)