Skip to content

Commit 687845a

Browse files
committed
PHP84: preg_match(): Passing null to parameter laravel#2 ($subject) of type string is deprecated
1 parent a75fa59 commit 687845a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Routing/UrlGenerator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,9 @@ public function format($root, $path, $route = null)
674674
*/
675675
public function isValidUrl($path)
676676
{
677-
if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) {
677+
if (
678+
$path !== null && !preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)
679+
) {
678680
return filter_var($path, FILTER_VALIDATE_URL) !== false;
679681
}
680682

0 commit comments

Comments
 (0)