From 6148b2197ac782ff814a24efb013d3b5909aed35 Mon Sep 17 00:00:00 2001 From: hopleus Date: Thu, 29 Feb 2024 14:17:08 +0300 Subject: [PATCH] Fixed remote redirect URL for federation shared files (Refactoring) Signed-off-by: hopleus --- lib/Service/FederationService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Service/FederationService.php b/lib/Service/FederationService.php index 7a0cddc9..be9d64bd 100644 --- a/lib/Service/FederationService.php +++ b/lib/Service/FederationService.php @@ -139,7 +139,8 @@ public function getRemoteRedirectURL(File $item, $direct = null) { } else { $wopi = $this->tokenManager->getRemoteTokenFromDirect($item, $direct->getUid()); } - $url = $remote . '/apps/officeonline/remote?shareToken=' . $item->getStorage()->getToken() . + + $url = rtrim($remote, '/') . '/index.php/apps/officeonline/remote?shareToken=' . $item->getStorage()->getToken() . '&remoteServer=' . $wopi->getServerHost() . '&remoteServerToken=' . $wopi->getToken(); if ($item->getInternalPath() !== '') {