[wp-trac] [WordPress Trac] #57979: Can't upload images to WordPress Comments

WordPress Trac noreply at wordpress.org
Fri Jan 23 16:02:07 UTC 2026


#57979: Can't upload images to WordPress Comments
-------------------------------------------------+-------------------------
 Reporter:  sbb                                  |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Comments                             |     Version:  6.0.3
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion dev-feedback   |     Focuses:
  changes-requested early                        |  administration
-------------------------------------------------+-------------------------
Changes (by ozgursar):

 * keywords:
     has-patch 2nd-opinion dev-feedback needs-testing changes-requested
     early
     => has-patch 2nd-opinion dev-feedback changes-requested early


Comment:

 == Patch Testing Report

 Patch Tested: https://github.com/WordPress/wordpress-develop/pull/5485

 === Environment
 - WordPress: 7.0-alpha-61215-src
 - PHP: 8.2.29
 - Server: nginx/1.29.4
 - Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
 - Browser: Chrome 144.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.4
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.1

 === Steps taken
 1. Edit any comment
 2. Add an image URL and click update
 3. Image is not saved

 4. Apply patch PR #5485
 5. ❌ Patch is failing to apply.

 `comment.php.rej`


 {{{
 @@ -2502,7 +2502,7 @@
         }

         $filter_comment = false;
 -       if ( ! has_filter( 'pre_comment_content', 'wp_filter_kses' ) ) {
 +       if ( ! current_user_can( 'unfiltered_html' ) && ! has_filter(
 'pre_comment_content', 'wp_filter_kses' ) ) {
                 $filter_comment = ! user_can( isset( $comment['user_id'] )
 ? $comment['user_id'] : 0, 'unfiltered_html' );
         }


 }}}


 === Expected result
 - Expected to be able to add an image to a comment added by any user.
 - Can not test this due to patch not applying.

 === Additional Notes
 - PR #5485 has conflicts that must be resolved

 === Screenshots/Screencast with results
 Add image to a comment before applying patch.
 Verify image code gets removed after clicking update.
 [[Image(https://i.imgur.com/pCQlRkM.png)]]

 Patch does not apply
 [[Image(https://i.imgur.com/SHSEeZS.png)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57979#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list