[wp-trac] [WordPress Trac] #50717: rest_no_routes with PHP 7.3

WordPress Trac noreply at wordpress.org
Tue Jul 21 11:14:29 UTC 2020


#50717: rest_no_routes with PHP 7.3
--------------------------+----------------------
 Reporter:  yozana        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  REST API      |     Version:  trunk
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by swissspidy):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 The group structure in your regex for the route is invalid.

 Try `(?P<id>[0-9]+)` instead of `(?P<>[0-9]+)`. Or even  simpler:
 `(?P<id>[\d]+)`

 Check how `WP_REST_Posts_Controller` registers the routes, and verify your
 regex using something like https://regex101.com/

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


More information about the wp-trac mailing list