[wp-trac] [WordPress Trac] #38401: PHP warning by WP_REST_Posts_Controller::prepare_items_query(): array_flip() can only flip string and integer values

WordPress Trac noreply at wordpress.org
Thu Oct 20 11:23:07 UTC 2016


#38401: PHP warning by WP_REST_Posts_Controller::prepare_items_query():
array_flip() can only flip string and integer values
--------------------------+-------------------------
 Reporter:  ocean90       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.7
Component:  REST API      |    Version:  trunk
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-------------------------
 Noticed this on w.org with the Handbook plugin which uses a boolean value
 for a query var, see
 https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
 /wp-content/plugins/handbook/handbook.php?rev=4036&marks=329,344#L322.


 {{{
 Warning: array_flip(): Can only flip STRING and INTEGER values! in /wp-
 includes/rest-api/endpoints/class-wp-rest-posts-controller.php on line 704
 Call Stack
 #       Time    Memory  Function        Location
 1       0.0001  257800  {main}( )       .../index.php:0
 2       0.0002  263432  require( '/wp-blog-header.php' )
 .../index.php:26
 3       0.4333  8246568 wp( )   .../wp-blog-header.php:16
 4       0.4333  8246784 WP->main( )     .../functions.php:955
 5       0.4334  8247392 WP->parse_request( )    .../class-wp.php:725
 6       0.4350  8300424 do_action_ref_array( )  .../class-wp.php:386
 7       0.4350  8300648 WP_Hook->do_action( )   .../plugin.php:515
 8       0.4350  8300744 WP_Hook->apply_filters( )       .../class-wp-
 hook.php:323
 9       0.4350  8301896 call_user_func_array:{/wp-includes/class-wp-
 hook.php:298} ( )   .../class-wp-hook.php:298
 10      0.4350  8302360 rest_api_loaded( )      .../class-wp-hook.php:298
 11      0.5132  9021664 WP_REST_Server->serve_request( )        .../rest-
 api.php:259
 12      0.5181  8926968 WP_REST_Server->dispatch( )     .../class-wp-rest-
 server.php:326
 13      0.5247  9094800 call_user_func:{/wp-includes/rest-api/class-wp-
 rest-server.php:928} ( ) .../class-wp-rest-server.php:928
 14      0.5247  9095336 WP_REST_Posts_Controller->get_items( )  .../class-
 wp-rest-server.php:928
 15      0.5293  9122160 WP_REST_Posts_Controller->prepare_items_query( )
 .../class-wp-rest-posts-controller.php:211
 16      0.5298  9130208 array_flip ( )  .../class-wp-rest-posts-
 controller.php:704
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38401>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list