WordPress.org

Support

Support » Plugins and Hacks » Twitget » [Resolved] Encoding error, ruins everything!

[Resolved] Encoding error, ruins everything!

  • One of my clients created a twitter post with some wacky characters. Frankly, I don’t know which characters they were – they simply displayed as rectangles.

    As soon as someone viewed the website, causing your plugin to run the update the options stored in the database (and hence the text from each recent tweet), all hell broke loose.

    Due to the non-UTF-8 nature of those characters, the MySQL server didn’t accept the remainder of the option string. This, obviously, caused a fatal error on the first chance it could when your plugin would try to retrieve information from it.

    I did my own makeshift solution as I was using this plugin for a MAJOR component of a MAJOR client’s site (thanks for that by the way), and it was breaking the layout badly. All I did was utf8_encode($tweets[$i][‘text’]) for all $i in count($tweets) before you added them to the $options array for updating.

    Look into it, it’s a pretty big issue. Looking forward to your next update having it – I hate having to hack solutions. Thanks!

    http://wordpress.org/extend/plugins/twitget/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Boštjan Cigan

    @zerocool51

    First of all thanks, this one has been eluding me for a while. Could you post the updated code on Pastebin or a similar service? I’ll commit the changes as soon as I get back from my vacation.

    Cheers.

    Glad I could help, http://pastebin.com/PieZyXf3 😀
    You can find the changes on lines 255 and 292. Note that they’re the encoding part. I didn’t have time to properly decode it or test it, it just stopped array serialization errors from occuring.

    Enjoy your vacation!

    Plugin Author Boštjan Cigan

    @zerocool51

    I’ve made the changes and will commit it soon.

    Cheers and thanks again.

    Plugin Author Boštjan Cigan

    @zerocool51

    Hey 2unco,

    Could you paste some of these “funky” characters, I’ve devised a somewhat different solution and would like to test it.

    Thank you.

    Cheers.

    Uhmm… I dunno if this helps, but:

    🐊🔥🔥🔥

    That’s all I could see – even on Twitter. Thanks for looking into it further 🙂

    Plugin Author Boštjan Cigan

    @zerocool51

    I’ve currently tested it with the following:

    漢字 かんじ 火 屵 苗 艹 σ τ υ φ χ ψ ω 🐊🔥🔥🔥

    And they show fine in the corrected version. I count these as “funky” 🙂

    I’ll commit ASAP.

    Cheers.

    Legen – wait for it…

    Fire? Oh they’re not squares! They actually look like things on my phone. Those crazy clients…

    dary!

    Thanks a bunch 😀

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Encoding error, ruins everything!’ is closed to new replies.
Skip to toolbar