diff --git a/src/JsonSchema/Uri/UriResolver.php b/src/JsonSchema/Uri/UriResolver.php index ced7a8da..8ab6650e 100644 --- a/src/JsonSchema/Uri/UriResolver.php +++ b/src/JsonSchema/Uri/UriResolver.php @@ -77,7 +77,11 @@ public function generate(array $components) public function resolve($uri, $baseUri = null) { // treat non-uri base as local file path - if (!is_null($baseUri) && !filter_var($baseUri, \FILTER_VALIDATE_URL)) { + if ( + !is_null($baseUri) && + !filter_var($baseUri, \FILTER_VALIDATE_URL) && + !preg_match('|^[^/]+://|u', $baseUri) + ) { if (is_file($baseUri)) { $baseUri = 'file://' . realpath($baseUri); } elseif (is_dir($baseUri)) {