From 0ef2caccc6861aad2bab8b62d657e39e2f230d40 Mon Sep 17 00:00:00 2001 From: nfebe Date: Thu, 23 Apr 2026 05:57:52 +0100 Subject: [PATCH] fix(files_sharing): Drop trailing '?' from public download redirect URL Public share download links now redirect to the public DAV endpoint cleanly when no additional query parameters are present. Previously the redirect always appended a trailing '?' to the target URL, which caused an Internal Server Error for clients that called the legacy download endpoint without query parameters (e.g. the Thunderbird FileLink extension). Links shared before this change are resolvable again. Signed-off-by: nfebe --- apps/files_sharing/lib/Controller/ShareController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 52facc04950..a2ca205fdaf 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -401,7 +401,9 @@ class ShareController extends AuthPublicShareController { } $davUrl = '/public.php/dav/files/' . $token . $davPath; - $davUrl .= '?' . http_build_query($params); + if (!empty($params)) { + $davUrl .= '?' . http_build_query($params); + } return new RedirectResponse($this->urlGenerator->getAbsoluteURL($davUrl)); } }