Skip to content

Commit 907c424

Browse files
committed
fix: fix unjailedroot of nested jails if there are other wrappers in between
Signed-off-by: Robin Appelman <[email protected]>
1 parent 16d0e1d commit 907c424

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lib/private/Files/Cache/Wrapper/CacheJail.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ public function __construct(
3131
) {
3232
parent::__construct($cache, $dependencies);
3333

34-
if ($cache instanceof CacheJail) {
35-
$this->unjailedRoot = $cache->getSourcePath($root);
36-
} else {
37-
$this->unjailedRoot = $root;
34+
$this->unjailedRoot = $root;
35+
$parent = $cache;
36+
while ($parent instanceof CacheWrapper) {
37+
if ($parent instanceof CacheJail) {
38+
$this->unjailedRoot = $parent->getSourcePath($this->unjailedRoot);
39+
}
40+
$parent = $parent->getCache();
3841
}
3942
}
4043

0 commit comments

Comments
 (0)