mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
REST API: Remove trailing slashes when preloading requests and add unit tests for it.
Props antonvlasenko. Fixes #51636. git-svn-id: https://develop.svn.wordpress.org/trunk@51648 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2818,6 +2818,11 @@ function rest_preload_api_request( $memo, $path ) {
|
||||
}
|
||||
}
|
||||
|
||||
$path = untrailingslashit( $path );
|
||||
if ( empty( $path ) ) {
|
||||
$path = '/';
|
||||
}
|
||||
|
||||
$path_parts = parse_url( $path );
|
||||
if ( false === $path_parts ) {
|
||||
return $memo;
|
||||
|
||||
Reference in New Issue
Block a user