• Resolved archon810

    (@archon810)


    The new update 2.2.3 ended up screwing up content on the site because it doesn’t handle decoding/encoding right and is invasive as it hooks into every post update. Here’s what happened to a normal html entity for a space character (& nbsp ?? https://i.imgur.com/VzJGa.jpg after saving a post after installing SC2.2.3: https://i.imgur.com/Zp1DU.jpg

    Because it makes the content invalid, the effect cascaded down to other plugins which broke the post display altogether. The worst part was that I updated 6-7 plugins altogether and had to revert them one by one until tracing it to this plugin.

    Upon examining the code changes, I found this:

    add_filter("content_save_pre", "soundcloud_reverse_shortcode");
    
    function soundcloud_reverse_shortcode($content) {
      return preg_replace_callback('/<iframe(?:(?!>).)*>.*?<\/iframe>/i', 'soundcloud_reverse_shortcode_callback', stripslashes(html_entity_decode($content)));
    }

    and so on. I’m not entirely positive where exactly the problem is located because I was scrambling to revert it, but I’d guess it’s a whole bunch of html_entity_decodings or using DOMDocument, or something else.

    Part of the point is, a plugin that should be limited to embeds of occasional shortcodes shouldn’t hook into every save (and end up mangling them big time). It looks like the logic is trying to permanently convert iframes to shortcodes, but forcing this behavior by default is entirely unnecessary.

    https://www.ads-software.com/extend/plugins/soundcloud-shortcode/

Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: SoundCloud Shortcode] Disastrous update 2.2.3 breaks encoding of posts’ is closed to new replies.