Make WordPress Core


Ignore:
Timestamp:
08/20/2021 11:43:21 PM (3 years ago)
Author:
azaozz
Message:

REST API: Remove trailing slashes when preloading requests and add unit tests for it.

Props antonvlasenko.
Fixes #51636.

File:
1 edited

Legend:

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

    r51278 r51648  
    28192819    }
    28202820
     2821    $path = untrailingslashit( $path );
     2822    if ( empty( $path ) ) {
     2823        $path = '/';
     2824    }
     2825
    28212826    $path_parts = parse_url( $path );
    28222827    if ( false === $path_parts ) {
Note: See TracChangeset for help on using the changeset viewer.