WordPress.org

Ready to get started?Download WordPress

Forums

Twitget
[resolved] Encoding error, ruins everything! (8 posts)

  1. 2unco
    Member
    Posted 11 months ago #

    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/

  2. Boštjan Cigan
    Member
    Plugin Author

    Posted 11 months ago #

    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.

  3. 2unco
    Member
    Posted 11 months ago #

    Glad I could help, http://pastebin.com/PieZyXf3 :D
    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!

  4. Boštjan Cigan
    Member
    Plugin Author

    Posted 11 months ago #

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

    Cheers and thanks again.

  5. Boštjan Cigan
    Member
    Plugin Author

    Posted 11 months ago #

    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.

  6. 2unco
    Member
    Posted 11 months ago #

    Uhmm... I dunno if this helps, but:

    🐊🔥🔥🔥

    That's all I could see - even on Twitter. Thanks for looking into it further :)

  7. Boštjan Cigan
    Member
    Plugin Author

    Posted 11 months ago #

    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.

  8. 2unco
    Member
    Posted 11 months ago #

    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 :D

Reply

You must log in to post.

About this Plugin

About this Topic