mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-12 02:51:59 +00:00
XmlValidationModeDetector peeks at the start of an XML document to choose between DTD- and XSD-based validation, skipping any DOCTYPE that appears inside an XML comment. Prior to this commit, consumeCommentTokens() short-circuited a line with no start or end comment marker by returning it unchanged, even while already inside a multi-line comment. Such a body line was then treated as content, so a literal "DOCTYPE" word in the comment body caused an XSD document to be misdetected as DTD-based. This commit honors the "in comment" parse state in that early return so a comment body line is treated as empty content, completing the fix for gh-27915 which only covered comment markers on the same line. Closes gh-36948 Signed-off-by: junhyeong9812 <pickjog@gmail.com>