[wp-trac] [WordPress Trac] #38306: WP_REST_Request->get_params strips numeric keys

WordPress Trac noreply at wordpress.org
Thu Oct 13 17:42:51 UTC 2016


#38306: WP_REST_Request->get_params strips numeric keys
--------------------------+-----------------------------
 Reporter:  sswells       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Right now, a numeric key is getting stripped.

 Request Body = {"41150":"API value"}

 $request->get_params = [1] => API value

 So line 453 in class-wp-rest-request.php:
 $params = array_merge( $params, (array) $this->params[ $type ] );

 should be:
 $params = $params + (array) $this->params[ $type ];

 Any chance of getting this into 4.7?

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


More information about the wp-trac mailing list