Skip to content

[webdav] Escape HTML entities by number#2600

Open
CodingKoopa wants to merge 1 commit into
meganz:masterfrom
CodingKoopa:master
Open

[webdav] Escape HTML entities by number#2600
CodingKoopa wants to merge 1 commit into
meganz:masterfrom
CodingKoopa:master

Conversation

@CodingKoopa

@CodingKoopa CodingKoopa commented Dec 1, 2021

Copy link
Copy Markdown

This pull request addresses issue #2599 by escaping the HTML entities by number, rather than the shorthand identifiers that strict XML parsers don't understand.

To obtain the list, I:

  • Downloaded Blink's HTML entity list
  • Removed entries at the bottom by hand that had two codepoints.
  • Removed duplicate entries by replacing
^"(.+?)","U\+([0-9a-fA-F]{5})"\n"(.+?)","U\+(\2)"$

with

"$1","U+$2"`
  • Converted the list to the source code format by replacing
^"(.+)?","U\+([0-9a-fA-F]{5})"$

with

        escapesec[$2] = "&#x$2;"; // $1

#2596 also fixes the aforementioned issue, which I admittedly didn't notice until submitting this PR. I believe they are sufficiently different approaches to the problem though.

This approach pollutes utils.cpp considerably, it may be better to split this off into a separate file.

Thanks!

@sergiohs84 sergiohs84 added the webdav Issue related to WebDAV support label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

webdav Issue related to WebDAV support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants