Skip to content

Commit 524c7d7

Browse files
Talvnpmbuildbot-nextcloud[bot]
authored andcommitted
Fix URL escaping of shared files
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
1 parent bcadf96 commit 524c7d7

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)