Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix(files_versions): Update unencrypted_size during rollback #50521

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
$filename = '/' . ltrim($file, '/');

// Fetch the userfolder to trigger view hooks
$root = \OC::$server->get(IRootFolder::class);

Check notice

Code scanning / Psalm

PossiblyFalseReference Note

Cannot call method getData on possibly false value
$userFolder = $root->getUserFolder($user->getUID());

$users_view = new View('/'.$user->getUID());
Expand Down Expand Up @@ -408,7 +408,8 @@
$fileInfo->getId(), [
'encrypted' => $oldVersion,
'encryptedVersion' => $oldVersion,
'size' => $oldFileInfo->getSize()
'size' => $oldFileInfo->getData()['size'],
'unencrypted_size' => $oldFileInfo->getData()['unencrypted_size'],
]
);

Expand All @@ -417,8 +418,6 @@
$files_view->touch($file, $revision);
Storage::scheduleExpire($user->getUID(), $file);

$node = $userFolder->get($file);

return true;
} elseif ($versionCreated) {
self::deleteVersion($users_view, $version);
Expand Down
Loading