Repository navigation
Conversation
HtmlCharacterEntityDecoder leaves numeric character references beyond Character.MAX_CODE_POINT undecoded, but decodes references to surrogate code points (U+D800 to U+DFFF), which are not characters: "�" becomes a lone high surrogate, i.e. an invalid UTF-16 string that turns into "?" once encoded, for instance as UTF-8. Leave such references undecoded, as is done for out-of-range values. Signed-off-by: Martin Mirchev <mmirchev@comp.nus.edu.sg>
|
Hi @Marti2203, and thanks for your interest in Spring Framework. You've opened more than a dozen PRs in the last 24 hours, and we can't review them at that pace. Each one needs a maintainer to read it, understand the context, and take responsibility for merging it. AI-assisted contributions are fine, but you're accountable for what you submit. You should understand each change, have run the build and tests, and be able to defend your choices in review. A large batch of PRs makes that hard and pushes the review work onto us. Please keep to a few open PRs at a time, and focus on changes that matter, like real bugs or improvements that are important to your projects. We'll review a few of these and might close the rest. Thanks for understanding. |
|
Hi @bclozel , sorry if it looked like spam. I will keep the open amount to 5. I fully understand the accountability aspect and am ready to discuss. |
|
Will keep the current 13, but not add anything more. Really sorry if I made a bad impression 😓 |
HtmlCharacterEntityDecoderleaves numeric character references beyondCharacter.MAX_CODE_POINTundecoded, but decodes references to surrogate code points (U+D800 to U+DFFF), which are not characters:HtmlUtils.htmlUnescape("x�y")returns"x\uD800y", a string with a lone high surrogate, which turns into?once encoded, for instance as UTF-8.This change leaves such references undecoded, as is done for out-of-range values. A new test,
HtmlUtilsTests.htmlUnescapeLeavesSurrogateReferencesUnchanged, checks�and�and the neighbouring퟿and, which are still decoded; it fails before the change and passes after it.Testing:
HtmlUtilsTestsandHtmlCharacterEntityReferencesTests,:spring-web:checkstyleMainandcheckstyleTestpass. 7.0.x and 6.2.x have the same code.The issue was found by an LLM-assisted tool and verified manually.