[wp-trac] [WordPress Trac] #62163: WP_REST_Request::get_params() includes unregistered args including rest_route when not using pretty permalinks

WordPress Trac noreply at wordpress.org
Thu Oct 3 17:46:38 UTC 2024


#62163: WP_REST_Request::get_params() includes unregistered args including
rest_route when not using pretty permalinks
----------------------------+---------------------
 Reporter:  westonruter     |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  low             |   Milestone:  6.8
Component:  REST API        |     Version:  4.4
 Severity:  normal          |  Resolution:
 Keywords:  good-first-bug  |     Focuses:
----------------------------+---------------------
Changes (by TimothyBlynJacobs):

 * keywords:   => good-first-bug
 * milestone:  Awaiting Review => 6.8


Comment:

 Yeah, it is intentional behavior that unregistered parameters make it
 through. I’d love to introduce a strict arguments flag that would have the
 behavior you describe. Because you’re exactly right, it isn’t a
 requirement that folks register their parameters ahead of time and I’ve
 seen plenty of examples where people don’t.

 For the plain permalinks issue, I agree. We should probably always drop
 rest_route when building the request from globals I think.

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


More information about the wp-trac mailing list