The tweets displayed on the right-hand column of my blog are displayed with an excellent little utility called HL Twtter.

I found a little bug: HL Twitter doesn’t seem to unescape HTML entities when displaying tweets.

I made a minor edit to the plugin’s functions.php file that appears to have resolved the issue. Add the four highlighted lines below to the hl_twitter_show_tweet() function to clean up the tweets a little before displaying them (additional lines provided for context):

I didn’t use chr() on lines 262 and 263 because it doesn’t support Unicode characters (such as the em-dash I was looking for).

As always, comments and suggestions are most welcome. It wouldn’t surprise me if there were some edge cases I didn’t catch.

Update 7/18: Got in touch with the developer, Luke. At some point, PHP is supposedly phasing out support for executing code in preg_replace but he’ll implement a different fix. Thanks! 🙂