Fix for WP-Footnotes Encoding Error

Filed under: ,

If you’re an avid user of the WP-footnotes WordPress plugin, you might have noticed a rather annoying bug.

Specifically, footnotes of the following kind:

Ironically enough, I now recall this scene from the movie What a Girl Wants, where Ian tells Daphne : “Why do you try so hard to fit in, when you’re born to stand out?”. At the time it sounded totally cool to me, but somehow it doesn’t translate that nicely into real life.

Rendered garbled, when hovering over the footnote number link, as shown in the screenshot:

Red circles mark the badly encoded symbols.

To fix this, simply replace line 217, in footnotes.php file from the plugin directory:

$id_title = str_replace('"', """, htmlentities(strip_tags($value['text']), ENT_QUOTES, 'UTF-8'));

With the following:

$id_title = str_replace('"', """, html_entity_decode(htmlentities(strip_tags($value['text'])), ENT_QUOTES, 'UTF-8'));

On a completely unrelated note, it only took me 2 months to type this up, from the time I fixed the issue. Gives a whole new meaning to procrastination, eh1 ?

  1. It’s fixed now, see? I can even use “quotes”… 😮 []