summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-22 16:39:49 +0200
committerGitHub <noreply@github.com>2016-06-22 16:39:49 +0200
commitae50e7236fe6d72d561b1c9c968c15471e3f2dcc (patch)
treef4660d882d14aa56cdcaa24cb61605f10156c554
parentd5f432884278ad67ef0420a2cbb9ba29307bb56a (diff)
parentfa3dc909a4b6e75c5ad1c49a3f35c1d2868141ea (diff)
downloadnextcloud-server-ae50e7236fe6d72d561b1c9c968c15471e3f2dcc.tar.gz
nextcloud-server-ae50e7236fe6d72d561b1c9c968c15471e3f2dcc.zip
Merge pull request #25225 from owncloud/enc-revertversionsize
Rollback version must also adjust cached size
-rw-r--r--apps/files_versions/lib/Storage.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 638a1916f6a..93f8b848ce8 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -336,9 +336,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)) {