Skip to content

Commit 1a02051

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Illuminate/Routing/UrlGenerator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,10 @@ 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
679+
&& !preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)
680+
) {
678681
return filter_var($path, FILTER_VALIDATE_URL) !== false;
679682
}
680683

0 commit comments

Comments
 (0)