Skip to content

Commit bbc5720

Browse files
Aribroscebe
authored andcommitted
Fixed issues with reducing url dots
1 parent 705e082 commit bbc5720

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ReferenceContext.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ private function reduceDots($path)
131131
//Confirm parent is valid
132132
if(!empty($parts[$parent]) && $parts[$parent] !== '..'){
133133
unset($parts[$parent]);
134-
unset($parts[$i]);
135134
}
135+
unset($parts[$i]);
136136
}
137137
}
138138
return '/'.implode('/', $parts);

tests/ReferenceContextTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ public function normalizeUriProvider()
179179
'/var/www/api/../definitions.yaml',
180180
'file:///var/www/definitions.yaml',
181181
],
182+
[
183+
'/./definitions.yaml',
184+
'file:///definitions.yaml',
185+
],
182186
[
183187
'/var/www/api/schema/../../definitions.yaml',
184188
'file:///var/www/definitions.yaml',

0 commit comments

Comments
 (0)