From: Roeland Jago Douma Date: Wed, 9 Aug 2017 09:56:31 +0000 (+0200) Subject: Fix copy from jailed storage X-Git-Tag: v12.0.3RC1~79^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=745ad2f323c789a12c39e0c31975ee4f0fe70a76;p=nextcloud-server.git 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 --- 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 */