diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2023-09-26 16:40:26 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2023-09-28 20:36:22 +0200 |
commit | 4f7032475e1a1c2e4c1bca344cb001cd485ca0e8 (patch) | |
tree | b73b82e849457bb57a0dca7e749fa546cad367cd /apps/files_trashbin | |
parent | f174e4a0575284fd6eb14ec2365962213093441f (diff) | |
download | nextcloud-server-4f7032475e1a1c2e4c1bca344cb001cd485ca0e8.tar.gz nextcloud-server-4f7032475e1a1c2e4c1bca344cb001cd485ca0e8.zip |
fix: encode uri for delete, restore and favorite
To encode # and other characters properly
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/src/actions/restoreAction.ts | 3 | ||||
-rw-r--r-- | apps/files_trashbin/src/services/trashbin.ts | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_trashbin/src/actions/restoreAction.ts b/apps/files_trashbin/src/actions/restoreAction.ts index 7ec349ee271..ab9ac784d7f 100644 --- a/apps/files_trashbin/src/actions/restoreAction.ts +++ b/apps/files_trashbin/src/actions/restoreAction.ts @@ -28,6 +28,7 @@ import axios from '@nextcloud/axios' import History from '@mdi/svg/svg/history.svg?raw' import logger from '../../../files/src/logger.js' +import { encodePath } from '@nextcloud/paths' registerFileAction(new FileAction({ id: 'restore', @@ -50,7 +51,7 @@ registerFileAction(new FileAction({ async exec(node: Node) { try { - const destination = generateRemoteUrl(encodeURI(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`)) + const destination = generateRemoteUrl(encodePath(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`)) await axios({ method: 'MOVE', url: node.source, diff --git a/apps/files_trashbin/src/services/trashbin.ts b/apps/files_trashbin/src/services/trashbin.ts index 9aef75ef6d5..d9ac3c7c70c 100644 --- a/apps/files_trashbin/src/services/trashbin.ts +++ b/apps/files_trashbin/src/services/trashbin.ts @@ -46,7 +46,7 @@ const resultToNode = function(node: FileStat): File | Folder { const nodeData = { id: node.props?.fileid as number || 0, - source: generateRemoteUrl('dav' + rootPath + node.filename), + source: generateRemoteUrl(encodePath('dav' + rootPath + node.filename)), // do not show the mtime column // mtime: new Date(node.lastmod), mime: node.mime as string, |