diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-22 18:11:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-22 18:11:20 +0200 |
commit | 3aaa33d9d405b826c599b4f1b6b8702ad1b62a77 (patch) | |
tree | 0d1e9223018bacd4c9611736d12bbbbfe5869e9f /apps | |
parent | 54209abb749cd2db9ffaca7a5c438c0172305dd1 (diff) | |
parent | 880ff122f11b51585d115892b8ba79b6900237bd (diff) | |
download | nextcloud-server-3aaa33d9d405b826c599b4f1b6b8702ad1b62a77.tar.gz nextcloud-server-3aaa33d9d405b826c599b4f1b6b8702ad1b62a77.zip |
Merge pull request #25228 from owncloud/stable9-enc-revertversionsize
[stable9] Rollback version must also adjust cached size
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_versions/lib/storage.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php index a1069410e70..1062f49cf69 100644 --- a/apps/files_versions/lib/storage.php +++ b/apps/files_versions/lib/storage.php @@ -337,9 +337,16 @@ class Storage { // Restore encrypted version of the old file for the newly restored file // This has to happen manually here since the file is manually copied below $oldVersion = $users_view->getFileInfo($fileToRestore)->getEncryptedVersion(); + $oldFileInfo = $users_view->getFileInfo($fileToRestore); $newFileInfo = $files_view->getFileInfo($filename); $cache = $newFileInfo->getStorage()->getCache(); - $cache->update($newFileInfo->getId(), ['encrypted' => $oldVersion, 'encryptedVersion' => $oldVersion]); + $cache->update( + $newFileInfo->getId(), [ + 'encrypted' => $oldVersion, + 'encryptedVersion' => $oldVersion, + 'size' => $oldFileInfo->getSize() + ] + ); // rollback if (self::copyFileContents($users_view, $fileToRestore, 'files' . $filename)) { |