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

Allow PrettyPrintWriter to replace invalid XML characters when not running in quirks mode #335

Closed
wants to merge 1 commit into from

Conversation

basil
Copy link
Contributor

@basil basil commented Apr 24, 2023

From jenkinsci/jenkins#7875:

For a general defense, PrettyPrintWriter.writeText (and .writeAttributeValue) could quietly replace NULs with some placeholder such as ^@ and not pretend to round-trip them.

This PR offers an alternative to quirks mode ("replacement mode") for XML 1.0 and XML 1.1 serialization that replaces invalid characters with the U+FFFD � replacement character, thus ensuring that the XML written out by PrettyPrintWriter is always valid XML 1.0 or XML 1.1 without forcing consumers to sanitize their input.

@joehni joehni self-assigned this May 3, 2023
@joehni joehni added this to the 1.4.x milestone May 3, 2023
@joehni
Copy link
Member

joehni commented May 3, 2023

This is actually a good idea!

@joehni joehni closed this in c2deef3 Sep 27, 2023
joehni pushed a commit that referenced this pull request Sep 27, 2023
@joehni joehni modified the milestones: 1.4.x, 1.4.21 Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants