diff --git src/wp-includes/rest-api/class-wp-rest-server.php src/wp-includes/rest-api/class-wp-rest-server.php
index eae1254..1a239a5 100644
|
|
class WP_REST_Server { |
763 | 763 | $path = $request->get_route(); |
764 | 764 | |
765 | 765 | foreach ( $this->get_routes() as $route => $handlers ) { |
| 766 | $match = preg_match( '@^' . $route . '$@i', $path, $args ); |
| 767 | |
| 768 | if ( ! $match ) { |
| 769 | continue; |
| 770 | } |
| 771 | |
766 | 772 | foreach ( $handlers as $handler ) { |
767 | 773 | $callback = $handler['callback']; |
768 | 774 | $response = null; |
… |
… |
class WP_REST_Server { |
771 | 777 | continue; |
772 | 778 | } |
773 | 779 | |
774 | | $match = preg_match( '@^' . $route . '$@i', $path, $args ); |
775 | | |
776 | | if ( ! $match ) { |
777 | | continue; |
778 | | } |
779 | | |
780 | 780 | if ( ! is_callable( $callback ) ) { |
781 | 781 | $response = new WP_Error( 'rest_invalid_handler', __( 'The handler for the route is invalid' ), array( 'status' => 500 ) ); |
782 | 782 | } |