summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-22 18:11:27 +0200
committerGitHub <noreply@github.com>2016-06-22 18:11:27 +0200
commita2a23a68ee29a507ea95b279d14822b7c1a8f456 (patch)
treee398c5e08ec4d55c21327bea9ca341706fcdff69 /apps
parent5b39016db457b1b87f0c9bd987f421c404762836 (diff)
parent9345e0dd849df72f656e502e4a00f67e1ded98c5 (diff)
downloadnextcloud-server-a2a23a68ee29a507ea95b279d14822b7c1a8f456.tar.gz
nextcloud-server-a2a23a68ee29a507ea95b279d14822b7c1a8f456.zip
Merge pull request #25229 from owncloud/stable8.2-enc-revertversionsize
[stable8.2] Rollback version must also adjust cached size
Diffstat (limited to 'apps')
-rw-r--r--apps/files_versions/lib/storage.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php
index 8ba1c1682f9..95c2e684d4c 100644
--- a/apps/files_versions/lib/storage.php
+++ b/apps/files_versions/lib/storage.php
@@ -306,6 +306,17 @@ class Storage {
$versionCreated = true;
}
+ $fileToRestore = 'files_versions' . $filename . '.v' . $revision;
+
+ $oldFileInfo = $users_view->getFileInfo($fileToRestore);
+ $newFileInfo = $files_view->getFileInfo($filename);
+ $cache = $newFileInfo->getStorage()->getCache();
+ $cache->update(
+ $newFileInfo->getId(), [
+ 'size' => $oldFileInfo->getSize()
+ ]
+ );
+
// rollback
if (self::copyFileContents($users_view, 'files_versions' . $filename . '.v' . $revision, 'files' . $filename)) {
$files_view->touch($file, $revision);