WebDAV: Unescape XML entities when reading the item list (#8138)

Without this, a file named "A & B.epub" is read as "A & B.pdf"
and will 404 when fetched.
This commit is contained in:
John Beard
2021-08-27 07:39:15 +01:00
committed by GitHub
parent c171a06212
commit dac3940ced

View File

@@ -115,7 +115,10 @@ function WebDavApi:listFolder(address, user, pass, folder_path)
item_fullpath = string.sub( item_fullpath, 1, -2 )
end
local is_current_dir = self:isCurrentDirectory( item_fullpath, address, path )
local item_name = util.urlDecode( FFIUtil.basename( item_fullpath ) )
item_name = util.htmlEntitiesToUtf8(item_name)
local is_not_collection = item:find("<[^:]*:resourcetype/>") or
item:find("<[^:]*:resourcetype></[^:]*:resourcetype>")