Make WordPress Core

Changes between Initial Version and Version 8 of Ticket #64314


Ignore:
Timestamp:
12/12/2025 01:48:49 AM (5 months ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #64314

    • Property Status changed from new to reviewing
    • Property Severity changed from critical to normal
    • Property Component changed from Posts, Post Types to Revisions
    • Property Owner set to westonruter
    • Property Version changed from 6.8.3 to 6.4
    • Property Milestone changed from Awaiting Review to 7.0
    • Property Keywords has-patch added
  • Ticket #64314 – Description

    initial v8  
    88The API request to save the post will fail, returning a 500 error. The PHP log will list say:
    99
    10   PHP Fatal error:  Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given
     10  `PHP Fatal error:  Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given`
    1111
    1212The cause of the error is the function `wp_save_post_revision`, at `wp-includes/revision.php`. At line 190 it uses `normalize_whitespace( $post->field )`, which only works with strings, however `$post->field` will be an array if the meta is an array  and that will cause the fatal error.