From 0cbea5855ec271b5616e9041f30218dc649684ee Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Mon, 21 Nov 2016 05:45:31 +0000 Subject: [PATCH] REST API: Trim trailing slashes from routes. WordPress' rewrites do this usually, but the behaviour was inconsistent when using non-pretty permalinks. Props joehoyle. Fixes #38873. git-svn-id: https://develop.svn.wordpress.org/trunk@39329 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/rest-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index ffc691916f..3d0b7ee6d5 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -256,7 +256,7 @@ function rest_api_loaded() { $server = rest_get_server(); // Fire off the request. - $server->serve_request( $GLOBALS['wp']->query_vars['rest_route'] ); + $server->serve_request( untrailingslashit( $GLOBALS['wp']->query_vars['rest_route'] ) ); // We're done. die();