Browse Source
The XML standard section 2.5 is quite specific: the string "--" (double-hyphen) MUST NOT occur within comments In fact, xmllint will complain about any comments that incorrectly contain an internal "--" sequence as they are not valid XML. Adjust the sanitation code to only pass through valid XML comments using the same pattern that _HashHTMLBlocks uses to recognize them. With this change, invalid XML comments will be treated as literal text by the sanitizer and have the initial "<" escaped to < thus rendering them as not a comment at all. Also take this opportunity to correct the comments in the _HashHTMLBlocks function from "HTML" to "XML" to reflect what it actually matches. Signed-off-by: Kyle J. McKay <mackyle@gmail.com>master
Kyle J. McKay
4 years ago
1 changed files with 6 additions and 5 deletions
Loading…
Reference in new issue