summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-06 11:17:17 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-06 11:17:17 +0100
commit8047597a81e06ec3f5fced6f1f48b4194d368305 (patch)
treedc29084fad8c501619de71322b8c9d3020559b42 /lib
parentbf941032a39047cc948af5887e43f664d05e1e40 (diff)
parent6d0a324144824a11751f21fbe784f90c735d690b (diff)
downloadnextcloud-server-8047597a81e06ec3f5fced6f1f48b4194d368305.tar.gz
nextcloud-server-8047597a81e06ec3f5fced6f1f48b4194d368305.zip
Merge pull request #20288 from owncloud/fix_20234
make sure that we update the unencrypted size for the versions
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/wrapper/encryption.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index 24b0ca4acac..8f5a7a05f01 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -480,6 +480,7 @@ class Encryption extends Wrapper {
* @param bool $preserveMtime
* @param bool $isRename
* @return bool
+ * @throws \Exception
*/
private function copyBetweenStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
@@ -487,7 +488,18 @@ class Encryption extends Wrapper {
// key from the original file. Just create a 1:1 copy and done
if ($this->isVersion($targetInternalPath) ||
$this->isVersion($sourceInternalPath)) {
- return $this->storage->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
+ $result = $this->storage->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
+ if ($result) {
+ $info = $this->getCache('', $sourceStorage)->get($sourceInternalPath);
+ // make sure that we update the unencrypted size for the version
+ if (isset($info['encrypted']) && $info['encrypted'] === true) {
+ $this->updateUnencryptedSize(
+ $this->getFullPath($targetInternalPath),
+ $info['size']
+ );
+ }
+ }
+ return $result;
}
// first copy the keys that we reuse the existing file key on the target location