-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Fix: Escape control characters in XML. #6672
Conversation
@Gerhut, thanks for your PR! By analyzing the annotation information on this pull request, we identified @gajus, @michaelficarra and @xjamundx to be potential reviewers |
Thanks for the pull request, @Gerhut! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
Thank you for your pull request. It looks like this may be your first contribution to a jQuery Foundation project, if so we need you to sign our Contributor License Agreement (CLA). 📝 Please visit http://contribute.jquery.org/CLA/ to sign. After you signed, the PR is checked again automatically after a minute. If there's still an issue, please reply here to let us know. If you've already signed our CLA, it's possible your git author information doesn't match your CLA signature (both your name and email have to match), for more information, check the status of your CLA check. |
Thanks for the pull request, @Gerhut! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
Thanks for the pull request, @Gerhut! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
LGTM |
LGTM |
Thanks @Gerhut! Adding 'do not merge' until the issue gets accepted. |
@@ -42,7 +42,7 @@ function xmlEscape(s) { | |||
case "'": | |||
return "'"; | |||
default: | |||
throw new Error("unreachable"); | |||
return "&#" + c.charCodeAt() + ";"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass 0 explicitly.
LGTM |
When generating XML report with control characters (like "\b" or "\n", they are sometimes used in JavaScript object keys and will cause messages.), some XML parser like SAX will crash. Escape these characters will avoid crashing.
LGTM |
LGTM, just waiting for others to take a look. |
LGTM |
What issue does this pull request address?
#6673
What changes did you make? (Give an overview)
Fix XML escape with ASCII control characters
Is there anything you'd like reviewers to focus on?
When generating XML report with control characters (like "\b" or "\n", they
are sometimes used in JavaScript object keys and will cause messages.),
some XML parser like SAX will crash.
Escape these characters will avoid crashing.