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.

Built from https://develop.svn.wordpress.org/trunk@39329


git-svn-id: http://core.svn.wordpress.org/trunk@39269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan McCue 2016-11-21 05:46:30 +00:00
parent ca9f71e9b2
commit 863505cf81
2 changed files with 2 additions and 2 deletions

View File

@ -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();

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-beta4-39328';
$wp_version = '4.7-beta4-39329';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.