fix: use unjailed source path when moving jailed files

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
pull/59252/head
Salvatore Martire 5 months ago
parent f8cc0adefb
commit bf24b24841
  1. 10
      lib/private/Files/Cache/Wrapper/CacheJail.php
  2. 2
      lib/private/Files/Cache/Wrapper/CacheWrapper.php

@ -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)];
}
/**

@ -198,7 +198,7 @@ class CacheWrapper extends Cache {
}
protected function getMoveInfo($path) {
/** @var Cache $cache */
/** @var Cache|CacheJail $cache */
$cache = $this->getCache();
return $cache->getMoveInfo($path);
}

Loading…
Cancel
Save