WordPress.org

Ready to get started?Download WordPress

Forums

Images in comment don't show after upgrade to 3.05 (11 posts)

  1. Enav
    Member
    Posted 3 years ago #

    Hello,

    First, thanks for WordPress, best CMS on the net!

    After upgrading to WordPress 3.05 from version 3.04, the images that were in my comments no longer show up. To make sure it was the upgrade, I installed WordPress 3.04 on a new domain, no plugins.

    I added a picture to a post and to that post's comment. The picture in the post and the comment show without problems.

    I then upgraded to version 3.05. When I view the same post and comment, the image in the post shows but the image in the comment does not.

    My temporary solution was to copy these files back from 3.04:
    wp-includes/default-filters.php
    wp-includes/version.php
    wp-includes/pluggable.php
    wp-includes/kses.php
    wp-includes/script-loader.php
    readme.html
    wp-admin/includes/post.php
    wp-admin/includes/update-core.php
    wp-admin/includes/template.php
    wp-admin/js/post.dev.js
    wp-admin/js/post.js
    wp-admin/async-upload.php

    Hope that helps!

  2. Enav
    Member
    Posted 3 years ago #

    I've done a bit more research and found that one of the changes in 3.05 was to the filtering of html in comments for administrators, perhaps in the kses.php file?

    I thought that maybe a setting the functions.php of my theme, something like:
    remove_action('comment_text', 'wp_filter_nohtml_kses', 10);
    (or is it remove_filter?)
    I'm not sure what the proper syntax is, but I'm afraid this would defeat the purpose of the file.

    Is there a way to allow admins to keep the images that were included in the comments? If I upgrade now, all the images visitors asked me to include in their comments are lost.

    Thanks!

  3. Enav
    Member
    Posted 3 years ago #

    Any suggestions?

  4. nikib0
    Member
    Posted 3 years ago #

    Same problem here.

    On upgrading to 3.05 I also lost images and videos posted in the comments by users and admins.

    I have since rolled-back to 3.04 as a temporary fix.

  5. Tim Rogers
    Member
    Posted 3 years ago #

    Copy back only the
    wp-includes/default-filters.php
    from 3.04 seems to fixed it.

  6. Enav
    Member
    Posted 3 years ago #

    So what in default-filters.php needs to be changed and how do we exclude that in our themes functions.php?

  7. Enav
    Member
    Posted 3 years ago #

    Anyone?

  8. Zaaikort
    Member
    Posted 3 years ago #

    Sorry, no real help here.
    The only difference in "default-filters.php" seems to be one extra line in the 3.0.5 version: it is the second line starting with "foreach" just after "// Keys". If Stealingisbad is right the temporary cure might be narrowed down to just commenting away this line.
    (I haven't yet checked this thoroughly.)

    foreach ( array( 'pre_post_status', 'pre_post_comment_status', 'pre_post_ping_status' ) as $filter ) {
    	add_filter( $filter, 'sanitize_key' );
    }
  9. Zaaikort
    Member
    Posted 3 years ago #

    I was wrong! Leave the obovementioned line in place.

    In default-filters.php of WP305
    under "// Kses only for textarea admin displays"
    replace , 'comment_text'
    by /* , 'comment_text' */
    (or remove it altogether if you like)

    Now the pictures in admin comments show up again!

    Take care, I did not check for any side effects of this amputation.

  10. Enav
    Member
    Posted 3 years ago #

    You are my new hero :)

    Thanks for taking the time Zaaikort!

  11. Zaaikort
    Member
    Posted 3 years ago #

    We did it together! Without even knowing what the code means.

    For those of you who can decipher Dutch:
    someone else has been tackling the same problem and has taken it a little further,
    http://www.kblog.nl/2011/02/ik-wil-mijn-plaatjes-terug/

    Conclusions:
    (1) The filtering-out of pictures in WP 3.0.5 is a safety measure, not a bug.
    (2) If you are the only admin of your WP, and your visitors are not given more status then 'subscriber', and all plugins are bonafide, then it is safe to amputate the piece of code. Safe enough for me anyway.

    Is this 'topic resolved' now? What do you folks think?

Topic Closed

This topic has been closed to new replies.

About this Topic