[wp-trac] [WordPress Trac] #59716: Deprecated messages exporting post meta with meta_value null from PHP 8.1

WordPress Trac noreply at wordpress.org
Wed Oct 25 04:48:03 UTC 2023


#59716: Deprecated messages exporting post meta with meta_value null from PHP 8.1
--------------------------+------------------------------
 Reporter:  bobbingwide   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Export        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  php81         |     Focuses:
--------------------------+------------------------------

Comment (by bobbingwide):

 Re: while the function is only intended to deal with strings.

 1. The wp_postmeta table's meta_value column is nullable. Ditto:
 wp_termmeta, wp_usermeta
 2. Therefore it seems reasonable for the field to contain null.
 3. The comment below was added 13 years ago today ( PHP 5.5? )
 {{{
  * @param string $str String to wrap in XML CDATA tag.
 }}}
 4. Some of the export calls are wrapped to not export data when it's
 `empty()`
 5. But those that aren't might also expect null values.
 6. There are 101 calls to wxr_cdata()
 7. I would implement a pragmatic solution to change the function not the
 callers.

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


More information about the wp-trac mailing list