diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-05-19 14:21:58 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-05-19 14:21:58 +0200 |
commit | 9c751f1d871179523e55f93777a473e808d4441b (patch) | |
tree | e5fd2799530f0c2288216672773ea03be9190bba /lib/private/files/storage/wrapper | |
parent | 8f1a609512744f38976582e9e31b2c14c8f90d01 (diff) | |
download | nextcloud-server-9c751f1d871179523e55f93777a473e808d4441b.tar.gz nextcloud-server-9c751f1d871179523e55f93777a473e808d4441b.zip |
use copy when doing a crossStorageCopy on the same storage
Diffstat (limited to 'lib/private/files/storage/wrapper')
-rw-r--r-- | lib/private/files/storage/wrapper/wrapper.php | 8 |
1 files changed, 8 insertions, 0 deletions
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); } |