Problem

If you fetch tweets from a Twitter user whose username contains an ampersand (e.g. "Foobar & Co.") then the username is rendered as "Foobar & Co.".

This seems to affect only the Twitter username.

I digged a bit in the code and it looks like we call check_plain() twice on the Twitter username:

  • First then we fetch the tweet in twitter_pull.class.inc
  • And then when we render it in twitter-pull-listing.tpl.php: l() calls check_plain() unless we pass the array('html' => TRUE) option

Proposed resolution

A solution would be to pass the array('html' => TRUE) option to l() in the template file. This seems to be safe since we already call check_plain() when fetching the tweet.

Attached is a proposed patch that implements the above.

CommentFileSizeAuthor
twitter_pull-html_entities.patch951 bytesfengtan

Comments

fengtan created an issue. See original summary.

fengtan’s picture

Title: HTML entities not decoded » HTML entities not decoded in Twitter username