Skip to content

Commit 0e088b2

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

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
@@ -677,7 +677,10 @@ public function format($root, $path, $route = null)
677677
*/
678678
public function isValidUrl($path)
679679
{
680-
if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) {
680+
if (
681+
$path !== null
682+
&& !preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)
683+
) {
681684
return filter_var($path, FILTER_VALIDATE_URL) !== false;
682685
}
683686

0 commit comments

Comments
 (0)