[wp-trac] [WordPress Trac] #59827: wp_save_post_revision() assumes ALL post meta is text! Fatal error in PHP 8.2.

WordPress Trac noreply at wordpress.org
Fri Nov 17 16:11:56 UTC 2023


#59827: wp_save_post_revision() assumes ALL post meta is text! Fatal error in PHP
8.2.
-------------------------------------------------+-------------------------
 Reporter:  jsmoriss                             |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Revisions                            |     Version:  6.3.2
 Severity:  normal                               |  Resolution:
 Keywords:  reporter-feedback has-patch needs-   |     Focuses:  php-
  unit-tests                                     |  compatibility
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 @jsmoriss writing tests for this I have realized that it is the use of
 `_wp_post_revision_fields` that creates the issue. Once you add the meta
 field to the revisions screen using this filter, it triggers the
 comparison section to see if the field changed when storing revisions.

 While we plain to add the meta revision hook automatically in
 https://core.trac.wordpress.org/ticket/59636 (so you won't need to use
 `_wp_post_revision_fields` to add your field to the display), I still
 think its work adding some protection against the issue you discovered.

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


More information about the wp-trac mailing list