mirror of
https://github.com/filegator/filegator.git
synced 2025-08-25 15:01:41 +02:00
Two consecutive periods bug - fixes #202
This commit is contained in:
@@ -235,8 +235,11 @@ class Filesystem implements Service
|
||||
|
||||
private function applyPathPrefix(string $path): string
|
||||
{
|
||||
if (strpos($path, '..') !== false) {
|
||||
$path = "/";
|
||||
if ($path == '..'
|
||||
|| strpos($path, '..'.$this->separator) !== false
|
||||
|| strpos($path, $this->separator.'..') !== false
|
||||
) {
|
||||
$path = $this->separator;
|
||||
}
|
||||
return $this->joinPaths($this->getPathPrefix(), $path);
|
||||
}
|
||||
|
Reference in New Issue
Block a user