Skip to content

Commit 5224ee9

Browse files
committed
fix: Add fallback to empty string when null value is passed in UriResolver::parse
1 parent ac94ea5 commit 5224ee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonSchema/Uri/UriResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class UriResolver implements UriResolverInterface
2828
*/
2929
public function parse($uri)
3030
{
31-
preg_match('|^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?|', $uri, $match);
31+
preg_match('|^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?|', $uri ?: '', $match);
3232

3333
$components = array();
3434
if (5 < count($match)) {

0 commit comments

Comments
 (0)