mirror of
https://github.com/nextcloud/server.git
synced 2026-04-13 21:17:20 -04:00
Merge pull request #59310 from nextcloud/backport/59252/stable33
[stable33] fix: use unjailed source path when moving jailed files
This commit is contained in:
commit
4b3c51eddf
2 changed files with 10 additions and 2 deletions
|
|
@ -68,6 +68,14 @@ class CacheJail extends CacheWrapper {
|
|||
}
|
||||
}
|
||||
|
||||
protected function getUnjailedSourcePath(string $path): string {
|
||||
if ($path === '') {
|
||||
return $this->getGetUnjailedRoot();
|
||||
} else {
|
||||
return $this->getGetUnjailedRoot() . '/' . ltrim($path, '/');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param null|string $root
|
||||
|
|
@ -189,7 +197,7 @@ class CacheJail extends CacheWrapper {
|
|||
* @return array [$storageId, $internalPath]
|
||||
*/
|
||||
protected function getMoveInfo($path) {
|
||||
return [$this->getNumericStorageId(), $this->getSourcePath($path)];
|
||||
return [$this->getNumericStorageId(), $this->getUnjailedSourcePath($path)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class CacheWrapper extends Cache {
|
|||
}
|
||||
|
||||
protected function getMoveInfo($path) {
|
||||
/** @var Cache $cache */
|
||||
/** @var Cache|CacheJail $cache */
|
||||
$cache = $this->getCache();
|
||||
return $cache->getMoveInfo($path);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue