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

Escaped XML characters in attribute values #10

Closed
jnunemaker opened this issue Apr 16, 2009 · 2 comments
Closed

Escaped XML characters in attribute values #10

jnunemaker opened this issue Apr 16, 2009 · 2 comments

Comments

@jnunemaker
Copy link
Owner

I think I’vs found a bug in httparty. When XML is parsed, escaped XML-characters (eg. ampersand) in attribute values are not replaced.

The method REXMLUtilityNode#translate_xml_entities is only used to unescape text values, the attribute values are left plain.

Example:
variant[‘url’] # “http://…/image.jpg?attr=val&attr2=val2”, not “http://…/image.jpg?attr=val&attr2=val2”.

What do you think?

Thanks and ciao,

der Flo

@jnunemaker
Copy link
Owner Author

I think it is an issue of REXML::Parsers::BaseParser. Other XML parsers do this unnormalization correctly. Some code says more than thousand words, so see here: http://gist.github.com/89945

I also tested this against ruby-1.9, the same problem.

I forked your crack-repo at github and fixed this issue. It would be nice if you would incorporate my changeset. I’ll send you a pull request.

from der_flo

@der-flo
Copy link

der-flo commented Apr 22, 2009

Thanks for accepting my patch for crack! Now everything works as expected.

der_flo

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants