Skip to content

Commit 6f9b4c4

Browse files
committed
fix(files): escape html entities in dav search requests
Signed-off-by: Kent Delante <kent@delante.me> This fixes a 'xmlParseEntityRef: no name' error returned when searching in files navigation while in folders with special characters in the name.
1 parent 73b3689 commit 6f9b4c4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/files/src/services/WebDavSearch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { ResponseDataDetailed, SearchResult } from 'webdav'
99
import { getCurrentUser } from '@nextcloud/auth'
1010
import { defaultRootPath, getDavNameSpaces, getDavProperties, resultToNode } from '@nextcloud/files/dav'
1111
import { getBaseUrl } from '@nextcloud/router'
12+
import escapeHTML from 'escape-html'
1213
import { logger } from '../utils/logger.ts'
1314
import { client } from './WebdavClient.ts'
1415

@@ -56,7 +57,7 @@ export async function searchNodes(query: string, { dir, signal }: SearchNodesOpt
5657
</d:select>
5758
<d:from>
5859
<d:scope>
59-
<d:href>/files/${user.uid}${dir || ''}</d:href>
60+
<d:href>/files/${user.uid}${dir ? escapeHTML(dir) : ''}</d:href>
6061
<d:depth>infinity</d:depth>
6162
</d:scope>
6263
</d:from>

0 commit comments

Comments
 (0)