-
Notifications
You must be signed in to change notification settings - Fork 241
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
what's BytesStart::unescaped for? #341
Comments
Actually, that method gives you all internal content of a tag (i.e. name + attributes). As such, it could have been intended in order to expand entities in all attributes in one pass. Probably we should remove it and provide other ways to get normalized attribute value (see also #371) |
Duplicate of #118 |
I suggest to deprecate or remove this method. I don't see any valid use for it. Entities are not allowed in tag names, and unescaping of attributes as a whole allows injection: <foo real="1" fake="2"/> unescapes to: <foo real="1" fake="2"/> |
I'm trying to switch to
quick-xml
and am struggling to understand the API for just getting strings (for tag names, attribute names, attribute values, and text/cdata nodes).I saw that the caller must unescaped text/cdata/attribute values, and this comment that the caller must decode the character encoding.
Next question: what is
BytesStart::unescaped
for? It says it handles escapes/entities like<
but that doesn't make sense to me. Is this the right grammar for the XML tag name from the spec?It looks like a
&
(aka#x26
) isn't allowed. So why unescape? or what am I missing?The text was updated successfully, but these errors were encountered: