Skip to content

Commit 59a7dbf

Browse files
Talvskjnldsv
authored andcommitted
Fix URL escaping of shared files
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
1 parent 1ed92c6 commit 59a7dbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mixins/PreviewUrl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323
import { generateUrl } from '@nextcloud/router'
2424
import { getRootPath, getToken, isPublic } from '../utils/davUtils'
25+
import { encodeFilePath } from '../utils/fileUtils'
2526

2627
export default {
2728
computed: {
@@ -66,7 +67,7 @@ export default {
6667
if (hasPreview) {
6768
// TODO: find a nicer standard way of doing this?
6869
if (isPublic()) {
69-
return generateUrl(`/apps/files_sharing/publicpreview/${getToken()}?fileId=${fileid}&file=${filename}&x=${screen.width}&y=${screen.height}&a=true`)
70+
return generateUrl(`/apps/files_sharing/publicpreview/${getToken()}?fileId=${fileid}&file=${encodeFilePath(filename)}&x=${screen.width}&y=${screen.height}&a=true`)
7071
}
7172
return generateUrl(`/core/preview?fileId=${fileid}&x=${screen.width}&y=${screen.height}&a=true`)
7273
}

0 commit comments

Comments
 (0)