Skip to content

Commit a6025d8

Browse files
fixed that resolveRelativeUri could receive invalid values
1 parent b79bd99 commit a6025d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/spec/Reference.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,9 @@ private function adjustRelativeReferences($referencedDocument, $basePath, $baseD
354354
continue;
355355
}
356356

357-
// non strings can't be references
358-
if (is_string($value) === false) {
357+
// only values of type string can be references
358+
// and only keys indicating a reference should be parsed
359+
if (! is_string($value) || ! in_array($key, ['$ref', 'externalValue'], true)) {
359360
continue;
360361
}
361362

0 commit comments

Comments
 (0)