From 228ca3a30da50f8de0d023f0edf726b6daece825 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 aef5aa36b47db..b1aec82e7006c 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -393,7 +393,9 @@ public function downloadShare($token, $files = null, $path = '') { } $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)); } }