[wp-trac] [WordPress Trac] #61244: The export_wp() function inserts empty <wp:comment> data when get_comment() returns a false or empty value

WordPress Trac noreply at wordpress.org
Sun Apr 20 17:37:16 UTC 2025


#61244: The export_wp() function inserts empty <wp:comment> data when get_comment()
returns a false or empty value
-------------------------------------------------+-------------------------
 Reporter:  WPExplorer                           |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.9
Component:  Export                               |     Version:  4.4
 Severity:  minor                                |  Resolution:
 Keywords:  reporter-feedback needs-testing-     |     Focuses:
  info                                           |  administration
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-patch needs-testing has-unit-tests => reporter-feedback
     needs-testing-info


Comment:

 == Bug Reproduction Report
 === Description
 ❌ This report can't validate that issue can be reproduced.

 Patch tested: https://github.com/WordPress/wordpress-
 develop/pull/8383.diff

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.28
 - Server: nginx/1.27.5
 - Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
 - Browser: Chrome 135.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.2
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.0

 === Bug Reprodution Steps

 1. Added the provided code:

 {{{#!php
 <?php
 add_action( 'export_wp', function() {
     add_filter( 'get_comment', '__return_false' );
 } );
 }}}

 2. Go to Tools > Export > Download Export File (for Posts, Categories:
 All, Authors: All, Status: All, No dates selected)

 3. ❌ I attach the resulting XML, full of Warnings.


 === Actual Results
 1.  ❌ Can't reproduce this problem

 === Additional Notes
 1. Note that I'm using Xdebug for debugging (this is why warnings in the
 resulting file, show xdebug errors).
 2. This XML file can be opened as an HTML to better see all the errors
 3. @WPExplorer are you confident that this provided snippet works?
 4. @abcd95 have you been able to reproduce it?

 === Supplemental Artifacts
 - Resulting XML

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


More information about the wp-trac mailing list