[wp-trac] [WordPress Trac] #51986: PHP Warning: array_intersect_key(): Expected parameter 1 to be an array, string given in class-wp-rest-server.php

WordPress Trac noreply at wordpress.org
Thu Dec 10 08:27:36 UTC 2020


#51986: PHP Warning: array_intersect_key(): Expected parameter 1 to be an array,
string given in class-wp-rest-server.php
------------------------------------------------+-----------------------
 Reporter:  slaFFik                             |       Owner:  (none)
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  5.6.1
Component:  Editor                              |     Version:  5.6
 Severity:  normal                              |  Resolution:
 Keywords:  reporter-feedback needs-patch php8  |     Focuses:  rest-api
------------------------------------------------+-----------------------
Changes (by aristath):

 * keywords:  reporter-feedback php8 has-patch => reporter-feedback needs-
     patch php8


Comment:

 I added a simple patch in https://github.com/WordPress/wordpress-
 develop/pull/802
 The patch checks if the 1st argument is a string, and if it is then
 converts it to an array prior to `array_intersect_key()`.

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


More information about the wp-trac mailing list