[wp-trac] [WordPress Trac] #34647: Don't return route URL in WP_REST_Request:get_params()

WordPress Trac noreply at wordpress.org
Wed Nov 18 07:05:26 UTC 2015


#34647: Don't return route URL in WP_REST_Request:get_params()
-----------------------------+-----------------------
 Reporter:  danielbachhuber  |       Owner:  rmccue
     Type:  defect (bug)     |      Status:  accepted
 Priority:  normal           |   Milestone:  4.4
Component:  REST API         |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+-----------------------

Comment (by rmccue):

 I'm OK with unsetting `$args[0]`; we can do that unconditionally though,
 as it's always `$path`.

 My only concern is that it may potentially break expectations if you have
 a route like `/tests/(\d+)`; this sets `$args[1]` to the number as you'd
 expect, but doesn't set `$args[0]` as you may expect if you know
 `preg_match`. This is super edge case though, to which the answer is
 "don't use `$args[0]`". :)

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


More information about the wp-trac mailing list