mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
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.
This commit is contained in:
parent
ee2d373ce4
commit
a064d8efc4
1 changed files with 2 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import type { ResponseDataDetailed, SearchResult } from 'webdav'
|
|||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
import { defaultRootPath, getDavNameSpaces, getDavProperties, resultToNode } from '@nextcloud/files/dav'
|
||||
import { getBaseUrl } from '@nextcloud/router'
|
||||
import escapeHTML from 'escape-html'
|
||||
import logger from '../logger.ts'
|
||||
import { client } from './WebdavClient.ts'
|
||||
|
||||
|
|
@ -56,7 +57,7 @@ export async function searchNodes(query: string, { dir, signal }: SearchNodesOpt
|
|||
</d:select>
|
||||
<d:from>
|
||||
<d:scope>
|
||||
<d:href>/files/${user.uid}${dir || ''}</d:href>
|
||||
<d:href>/files/${user.uid}${dir ? escapeHTML(dir) : ''}</d:href>
|
||||
<d:depth>infinity</d:depth>
|
||||
</d:scope>
|
||||
</d:from>
|
||||
|
|
|
|||
Loading…
Reference in a new issue