Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix URL escaping of shared files
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
  • Loading branch information
Talv authored and npmbuildbot-nextcloud[bot] committed Nov 7, 2020
commit c037156128c0579a90b2e231e2b9463722b650b1
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/mixins/PreviewUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
import { generateUrl } from '@nextcloud/router'
import { getRootPath, getToken, isPublic } from '../utils/davUtils'
import { encodeFilePath } from '../utils/fileUtils'

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