Skip to content

Commit e98ec3c

Browse files
nfebebackportbot[bot]
authored andcommitted
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 <fenn25.fn@gmail.com>
1 parent 9e720eb commit e98ec3c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/files_sharing/lib/Controller/ShareController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ public function downloadShare($token, $files = null, $path = '') {
430430
}
431431

432432
$davUrl = '/public.php/dav/files/' . $token . $davPath;
433-
$davUrl .= '?' . http_build_query($params);
433+
if (!empty($params)) {
434+
$davUrl .= '?' . http_build_query($params);
435+
}
434436
return new RedirectResponse($this->urlGenerator->getAbsoluteURL($davUrl));
435437
}
436438
}

0 commit comments

Comments
 (0)