[wp-trac] [WordPress Trac] #60771: PHP 8 Fatal error in WP_REST_Search_Controller

WordPress Trac noreply at wordpress.org
Fri Mar 15 11:23:33 UTC 2024


#60771: PHP 8 Fatal error in WP_REST_Search_Controller
-------------------------------------------------+-------------------------
 Reporter:  dd32                                 |       Owner:  swissspidy
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.6
Component:  REST API                             |     Version:  5.0
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  php8 has-patch has-unit-tests        |     Focuses:  rest-api
  commit                                         |
-------------------------------------------------+-------------------------
Changes (by swissspidy):

 * owner:  (none) => swissspidy
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"57839" 57839]:
 {{{
 #!CommitTicketReference repository="" revision="57839"
 REST API: Prevent error when passing invalid `type` parameter to search
 endpoint.

 In `WP_REST_Search_Controller`, the `type` parameter is accessed via the
 sanitization callback for the `subtype` parameter, which is too early for
 `type` itself to be already sanitized. This change adds a type check in
 the `get_search_handler()` method to prevent errors when the type doesn’t
 match.

 Props swissspidy, timothyblynjacobs, dd32.
 Fixes #60771.
 }}}

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


More information about the wp-trac mailing list