Repository navigation
Escape '"' in XMLPrinter::PrintString when processEntities is false - #1112
Open
darshan-mog wants to merge 1 commit into
Open
darshan-mog wants to merge 1 commit into
darshan-mog wants to merge 1 commit into
Conversation
With entity processing off, attribute values are written raw but always inside double quotes. A '"' read from a single-quoted attribute then ends the value early, so <user name='bob" role="admin'/> is saved as <user name="bob" role="admin"/> and reloads with a role attribute.
This branch has not been deployed
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.
With entity processing off (
XMLDocument doc(false)),XMLPrinter::PrintStringwrites attribute values raw, butPushAttributealways wraps them in double quotes, so a"read from a single-quoted attribute ends the value early:<user name='bob" role="admin'/>has noroleattribute, yetPrint()saves it as<user name="bob" role="admin"/>, which reloads withrole="admin"(values set withSetAttribute()break out the same way). Escape"as"in that branch only, so entity references in attribute values and all text output still pass through unchanged, and add a regression test next to the existing preserve-entities print test from #651.