summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2023-09-26 16:29:58 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2023-09-26 16:47:01 +0200
commitd280912f31756593fb877ad3c6129399a30e019b (patch)
tree5cac57bed424b37973732f16f1c7eb70ab4e7c6d /apps
parente0adcc587ecf484502303ebf93b22af3d0d9d895 (diff)
downloadnextcloud-server-d280912f31756593fb877ad3c6129399a30e019b.tar.gz
nextcloud-server-d280912f31756593fb877ad3c6129399a30e019b.zip
fix: encode uri for trashbin delete
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/src/actions/restoreAction.ts3
-rw-r--r--apps/files_trashbin/src/services/trashbin.ts3
2 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_trashbin/src/actions/restoreAction.ts b/apps/files_trashbin/src/actions/restoreAction.ts
index a29aef3ba83..d3e3f66a1df 100644
--- a/apps/files_trashbin/src/actions/restoreAction.ts
+++ b/apps/files_trashbin/src/actions/restoreAction.ts
@@ -29,6 +29,7 @@ import History from '@mdi/svg/svg/history.svg?raw'
import { registerFileAction, FileAction } from '../../../files/src/services/FileAction.ts'
import logger from '../../../files/src/logger.js'
+import { encodePath } from '@nextcloud/paths'
registerFileAction(new FileAction({
id: 'restore',
@@ -51,7 +52,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 9982750ba5c..6027765dc4d 100644
--- a/apps/files_trashbin/src/services/trashbin.ts
+++ b/apps/files_trashbin/src/services/trashbin.ts
@@ -28,6 +28,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav'
import type { ContentsWithRoot } from '../../../files/src/services/Navigation.ts'
import client, { rootPath } from './client'
+import { encodePath } from '@nextcloud/paths'
const data = `<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:"
@@ -57,7 +58,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)),
mtime: new Date(node.lastmod),
mime: node.mime as string,
size: node.props?.size as number || 0,