You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/ezio-melotti'closed_at=Nonecreated_at=<Date2015-09-26.16:46:39.294>labels= ['type-bug', 'library']
title='HTMLParser handle_starttag replaces entity references in attribute value even without semicolon'updated_at=<Date2015-09-26.17:06:12.433>user='https://bugs.python.org/frogcoder'
In the document of HTMLParser.handle_starttag, it states "All entity references from html.entities are replaced in the attribute values." However it will replace the string if it matches ampersand followed by the entity name without the semicolon.
For example <a href="go?t=buy¤cy=usd">foo</a> will produce "t=buy¤cy=usd" as the value of href attribute due to "curren" is the entity name for the currency sign.
If the character reference is being consumed as part of an attribute, and the last character matched is not a ";" (U+003B) character, and the next character is either a "=" (U+003D) character or an alphanumeric ASCII character, then, for historical reasons, all the characters that were matched after the U+0026 AMPERSAND character (&) must be unconsumed, and nothing is returned. However, if this next character is in fact a "=" (U+003D) character, then this is a parse error, because some legacy user agents will misinterpret the markup in those cases.
Off the top of my head, this paragraph is not implemented in HTMLParser (and it should).
Also note that <a href="go?t=buy¤cy=usd">foo</a> is not valid HTML and the & should have been escaped with &.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: