Repository navigation
Conversation
Namespace URIs were written into the xmlns attribute without escaping them, unlike regular attribute values. A URI like
urn:example"/
8000
><injected foo="bar">
would close the element early, giving you XML that is either malformed or, worse, parses into a different structure than the one you wrote.
Namespace URIs are now escaped the same way attribute values are. When writing with XMLWriter, the declaration now also uses the configured attribute quote character instead of a hard-coded double quote.
Namespace's `asXML()` also wrote the URI unescaped. It now escapes it. (It has no output format to take a quote character from, so it keeps using double quotes.)
Fixes dom4j#107
Author
|
If this fix gets accepted I'd appreciate it being backported to a release on the 2.1 branch (our project cannot make the migration from JavaEE to Jakarta EE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Namespace URIs were written into the xmlns attribute without escaping them, unlike regular attribute values. A URI like
would close the element early, giving you XML that is either malformed or, worse, parses into a different structure than the one you wrote.
Namespace URIs are now escaped the same way attribute values are. When writing with XMLWriter, the declaration now also uses the configured attribute quote character instead of a hard-coded double quote.
Namespace's
asXML()also wrote the URI unescaped. It now escapes it. (It has no output format to take a quote character from, so it keeps using double quotes.)Fixes #107