We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70fc5bf commit 9c08ebeCopy full SHA for 9c08ebe
src/ReferenceContext.php
@@ -115,14 +115,16 @@ private function reduceDots($path)
115
{
116
$parts = explode('/', ltrim($path, '/'));
117
$c = count($parts);
118
+ $parentOffset = 1;
119
for ($i = 0; $i < $c; $i++) {
120
if ($parts[$i] === '.') {
121
unset($parts[$i]);
122
continue;
123
}
- if ($i > 0 && $parts[$i] === '..' && $parts[$i-1] !== '..') {
124
- unset($parts[$i-1]);
+ if ($i > 0 && $parts[$i] === '..' && $parts[$i - $parentOffset] !== '..') {
125
+ unset($parts[$i - $parentOffset]);
126
127
+ $parentOffset += 2;
128
129
130
return '/'.implode('/', $parts);
0 commit comments