diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-23 10:42:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-23 10:42:45 +0200 |
commit | bba6470b8854e19c8ec82b88a3f29b26111200b8 (patch) | |
tree | 461b7149a94bb624d4377c2dc5c368889868d4e5 | |
parent | ec387a604dea6f10345432bbfdd2dd13bf0fd53c (diff) | |
parent | d3537ae33f1415b3615a8c9878f14b17ec05c4fb (diff) | |
download | nextcloud-server-bba6470b8854e19c8ec82b88a3f29b26111200b8.tar.gz nextcloud-server-bba6470b8854e19c8ec82b88a3f29b26111200b8.zip |
Merge pull request #25230 from owncloud/stable8.1-enc-revertversionsize
[stable8.1] Rollback version must also adjust cached size
-rw-r--r-- | apps/files_versions/lib/storage.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php index 815f089d21b..f7072a06697 100644 --- a/apps/files_versions/lib/storage.php +++ b/apps/files_versions/lib/storage.php @@ -300,6 +300,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); |