Support » Fixing WordPress » WP 3.0.5 bug?

  • advanpix

    (@advanpix)


    Just upgraded to WP 3.0.5. …. and now I cannot insert img tags in comments. They just eaten up by the WP – source code in the published comment is empty.

    I tried different themes – same result.

    Also I tried to insert images using filter add_filter(“comment_text”,…) (I develop plugin which renders LaTeX equations into images) – same result.

    Under admin or logged out – same result.

    Also, I cannot see img tags in comments when I browse them through admin (“Comments” menu) and in front-end pages/posts.

    And one more – pre tags in comments also are being eaten up by WP 3.0.5 – nothing get through sanitization/security enhancement???

    I have strong feeling this is related to new feature of WP 3.0.5:
    “Enhancement: Force HTML filtering on comment text in the admin”

    Any idea what is going on?

Viewing 15 replies - 1 through 15 (of 34 total)
  • advanpix

    (@advanpix)

    Here is link to the page where you can test img insertion on my site

    QuickLaTeX: tikZ graphics

    advanpix

    (@advanpix)

    My friend just did the same test on his blog (with no plugins, etc. ).

    Result is the same – img tags are being cut out from the comments!!!!

    dragonc

    (@dragonc)

    there appear to be bugs in this new version, there are several posts about different issues in the last hour or so.

    advanpix

    (@advanpix)

    Well I found problem:
    In 3.0.5 file wp-includes/default-filters.php line 35 looks like:

    foreach ( array( ‘term_description’, ‘link_description’, ‘link_notes’, ‘user_description’, ‘comment_text’ ) as $filter ) {

    Just remove bold text and “,” before it. Then it will work fine.

    Pitty I cannot commit to WordPress svn.

    Moderator Samuel Wood (Otto)

    (@otto42)

    Yep. Bug.

    Specifically, the comment_text was only meant to be cleaned up on the admin side of things, but it accidentally is getting cleaned on both sides.

    The bug only made it into the 3.0 branch, not into 3.1. So the error will be fixed in 3.1. This code in a theme’s functions.php should workaround it for now:

    add_action('init','workaround');
    function workaround() {
    remove_filter( 'comment_text', 'wp_kses_data' );
    }
    kabitzin

    (@kabitzin)

    Otto’s workaround fixed the problem for me. Any idea if this will be fixed in a 3.0.5.x update or will we have to wait till 3.1?

    Moderator Andrew Nacin

    (@nacin)

    Lead Developer

    Our current thinking is that we’re not going to do a 3.0.x. We’re working on some improvements for this for 3.1 (due very soon).

    But also, we plan to offer this as a hotfix through a plugin. I’ll be back shortly with details.

    Moderator Samuel Wood (Otto)

    (@otto42)

    Akismet has the hotfix. Upgrade Akismet to solve the issue.

    Andy Bailey

    (@commentluv)

    thanks for that otto, an image wasn’t showing in the link commentluv adds to comments and I thought I was going to have to update the plugin but luckily it wasn’t my plugin at fault.

    Upgrading akismet fixed it for now. ta

    Moderator Andrew Nacin

    (@nacin)

    Lead Developer

    Definitive solution:

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

    You can also update Akismet to 2.5.3 (it also contains the fix), but we have some fun plans for the Hotfix plugin, so I’d install/update both.

    Sorry for the inconvenience on this.

    kabitzin

    (@kabitzin)

    Both cool solutions, thanks guys

    luksusdyret

    (@luksusdyret)

    So… I upgraded today, and some of my images in previous posts just disappeared. I guess it’s because of this bug?

    I innstalled the fix but the pictures are still gone :/ what to do?

    dragonc

    (@dragonc)

    Try re-uploading them.

    luksusdyret

    (@luksusdyret)

    That’s kind of what I’m trying to avvoid…

    It’s like on many old posts, don’t want to have to go back to all the old posts and try to remember wich pictures I used in them ……. That’s kind of a huge job.

    Moderator Andrew Nacin

    (@nacin)

    Lead Developer

    This won’t touch images in posts, only comments. It also doesn’t damage them, only hide them temporarily (until the fix is applied). You likely have another issue.

Viewing 15 replies - 1 through 15 (of 34 total)
  • The topic ‘WP 3.0.5 bug?’ is closed to new replies.