[wp-trac] [WordPress Trac] #64901: rest_convert_error_to_response() fatals when WP_Error data is a stdClass object in 7.0-beta5

WordPress Trac noreply at wordpress.org
Tue Mar 24 17:38:28 UTC 2026


#64901: rest_convert_error_to_response() fatals when WP_Error data is a stdClass
object in 7.0-beta5
---------------------------------------------+--------------------------
 Reporter:  nateallen                        |       Owner:  westonruter
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  7.0
Component:  REST API                         |     Version:  trunk
 Severity:  critical                         |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  rest-api
---------------------------------------------+--------------------------
Changes (by westonruter):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"62107" 62107]:
 {{{
 #!CommitTicketReference repository="" revision="62107"
 Code Modernization: Fix `rest_convert_error_to_response()` handling of
 non-array error data when obtaining `status`.

 While the error data is normally an array, this is not guaranteed. This
 issue would have been detected by PHPStan rule level 9, since
 `WP_Error::get_all_error_data()` returns `mixed[]`.

 Developed in https://github.com/WordPress/wordpress-develop/pull/11307

 Follow-up to r61429.

 Props nateallen, desrosj, jorbin, mukesh27, westonruter.
 See #63430.
 Fixes #64901.
 }}}

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


More information about the wp-trac mailing list