Skip to content

Commit cc047b2

Browse files
committed
fix: Replace the deprecated direct download link with the public DAV endpoint
Follow-up of #48098 Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 329d21f commit cc047b2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,7 @@ public function renderPage(IShare $share, string $token, string $path): Template
149149
$headerActions = [];
150150
if ($view !== 'public-file-drop' && !$share->getHideDownload()) {
151151
// The download URL is used for the "download" header action as well as in some cases for the direct link
152-
$downloadUrl = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', [
153-
'token' => $token,
154-
'filename' => ($shareNode instanceof File) ? $shareNode->getName() : null,
155-
]);
152+
$downloadUrl = $this->urlGenerator->getAbsoluteURL('/public.php/dav/files/' . $token . '/?accept=zip');
156153

157154
// If not a file drop, then add the download header action
158155
$headerActions[] = new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $downloadUrl, 0, (string)$shareNode->getSize());

0 commit comments

Comments
 (0)