Fix copy from jailed storage

If we have a jailed storage we must also fix the internal path on copy.
Else we pass in the wrong path.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-08-09 11:56:31 +02:00
parent d7645ee928
commit ace7b69aa7
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 6 additions and 0 deletions

View File

@ -412,6 +412,12 @@ class Local extends \OC\Files\Storage\Common {
*/
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) {
if ($sourceStorage->instanceOfStorage(Jail::class)) {
/**
* @var \OC\Files\Storage\Wrapper\Jail $sourceStorage
*/
$sourceInternalPath = $sourceStorage->getUnjailedPath($sourceInternalPath);
}
/**
* @var \OC\Files\Storage\Local $sourceStorage
*/