WordPress.org

Make WordPress Core

Changeset 39329


Ignore:
Timestamp:
11/21/16 05:45:31 (11 months ago)
Author:
rmccue
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r39296 r39329  
    257257 
    258258    // Fire off the request. 
    259     $server->serve_request( $GLOBALS['wp']->query_vars['rest_route'] ); 
     259    $server->serve_request( untrailingslashit( $GLOBALS['wp']->query_vars['rest_route'] ) ); 
    260260 
    261261    // We're done. 
Note: See TracChangeset for help on using the changeset viewer.