From 9c751f1d871179523e55f93777a473e808d4441b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 19 May 2015 14:21:58 +0200 Subject: use copy when doing a crossStorageCopy on the same storage --- lib/private/files/storage/wrapper/wrapper.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/private/files/storage/wrapper') diff --git a/lib/private/files/storage/wrapper/wrapper.php b/lib/private/files/storage/wrapper/wrapper.php index f3dc09db138..14024addec4 100644 --- a/lib/private/files/storage/wrapper/wrapper.php +++ b/lib/private/files/storage/wrapper/wrapper.php @@ -513,6 +513,10 @@ class Wrapper implements \OC\Files\Storage\Storage { * @return bool */ public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { + if ($sourceStorage === $this) { + return $this->copy($sourceInternalPath, $targetInternalPath); + } + return $this->storage->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); } @@ -523,6 +527,10 @@ class Wrapper implements \OC\Files\Storage\Storage { * @return bool */ public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { + if ($sourceStorage === $this) { + return $this->rename($sourceInternalPath, $targetInternalPath); + } + return $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); } -- cgit v1.2.3