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

validate xml element names #7965

Merged
merged 5 commits into from
Jul 17, 2019

Conversation

Blacksmoke16
Copy link
Member

@Blacksmoke16 Blacksmoke16 commented Jul 15, 2019

Uses LibXML.xmlValidateNameValue to validate the provided name when using XML::Builder to build elements.

Fixes #7963
Fixes Blacksmoke16/oq#9

src/xml/builder.cr Outdated Show resolved Hide resolved
@asterite asterite added kind:feature topic:stdlib:serialization kind:bug A bug in the code. Does not apply to documentation, specs, etc. and removed kind:feature labels Jul 15, 2019
src/xml/builder.cr Outdated Show resolved Hide resolved
Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

src/xml/builder.cr Outdated Show resolved Hide resolved
@asterite asterite added this to the 0.30.0 milestone Jul 17, 2019
@asterite asterite merged commit dd3c82e into crystal-lang:master Jul 17, 2019
@Blacksmoke16 Blacksmoke16 deleted the validate-xml-element-names branch July 17, 2019 12:10
dnamsons pushed a commit to dnamsons/crystal that referenced this pull request Jan 10, 2020
* validate xml element names

* validate name and prefix separately

* keep things DRY

* only check for null bytes once

* pass unsafe name to StartElement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:serialization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XML::Builder allows creating elements with invalid names Prevent invalid XML output
4 participants