Skip to content

Commit 0761693

Browse files
authored
Merge pull request #59867 from nextcloud/fix/public-share-download-redirect-trailing-question-mark
fix(files_sharing): Drop trailing '?' from public download redirect URL
2 parents 1a27121 + 0ef2cac commit 0761693

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
@@ -401,7 +401,9 @@ public function downloadShare(string $token, ?string $files = null, string $path
401401
}
402402

403403
$davUrl = '/public.php/dav/files/' . $token . $davPath;
404-
$davUrl .= '?' . http_build_query($params);
404+
if (!empty($params)) {
405+
$davUrl .= '?' . http_build_query($params);
406+
}
405407
return new RedirectResponse($this->urlGenerator->getAbsoluteURL($davUrl));
406408
}
407409
}

0 commit comments

Comments
 (0)