From 745ad2f323c789a12c39e0c31975ee4f0fe70a76 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 9 Aug 2017 11:56:31 +0200 Subject: [PATCH] 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 --- lib/private/Files/Storage/Local.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 70cb2e0ccc4..c4e2dd68339 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -411,6 +411,12 @@ class Local extends \OC\Files\Storage\Common { */ public function copyFromStorage(\OCP\Files\Storage $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 */ -- 2.39.5