Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out null as well when writing XML #376

Merged
merged 3 commits into from
Dec 31, 2021

Conversation

huntharo
Copy link
Contributor

  • I ran into an actual usage pattern where there was a null (0x00) present in a string passed to sitemap.js
  • The null was written into the XML output file with no issues
  • xmllint --format on the resulting file would fail with output like the following:
some.xml:1317: parser error : Char 0x0 out of allowed range
the quick brown fox jumped over the lazy dog.
                                                                              ^
some.xml:1317: parser error : Premature end of data in tag title line 1317
the quick brown fox jumped over the lazy dog.
  • The filter for invalid characters being written to XML handled the range \u0001-\u0008 and others
  • It looks like control characters were allowed in XML 1.1 but that NULL has never been allowed, at least according to this answer:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants