Two consecutive periods bug - fixes #202

This commit is contained in:
Milos Stojanovic
2021-03-23 10:30:42 +01:00
parent eda587daff
commit 86b9752b38
2 changed files with 7 additions and 2 deletions

View File

@@ -403,6 +403,8 @@ class FilesystemTest extends TestCase
$this->assertEquals('/john/test.txt/', $this->invokeMethod($this->storage, 'applyPathPrefix', ['test.txt/']));
// no escaping path to upper dir
$this->assertEquals('/john/', $this->invokeMethod($this->storage, 'applyPathPrefix', ['/..']));
$this->assertEquals('/john/', $this->invokeMethod($this->storage, 'applyPathPrefix', ['..']));
$this->assertEquals('/john/', $this->invokeMethod($this->storage, 'applyPathPrefix', ['../']));
$this->assertEquals('/john/', $this->invokeMethod($this->storage, 'applyPathPrefix', ['/sub/../../']));
}