Skip to content

Commit

Permalink
fix: Fix version access with new version backend on shared files
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot-nextcloud[bot] committed Dec 4, 2023
1 parent 3c958a7 commit 565180e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,8 @@ public function getFile($fileId,
$file = $this->getFileForWopiToken($wopi);
\OC_User::setIncognitoMode(true);
if ($version !== '0') {
$userFolder = $this->rootFolder->getUserFolder($wopi->getOwnerUid());
$versionManager = \OC::$server->get(IVersionManager::class);
$info = $versionManager->getVersionFile($userFolder->getOwner(), $file, $version);
$info = $versionManager->getVersionFile($this->userManager->get($wopi->getUserForFileAccess()), $file, $version);
if ($info->getSize() === 0) {
$response = new Http\Response();
} else {
Expand Down

0 comments on commit 565180e

Please sign in to comment.