rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -311,7 +311,7 @@ class WP_REST_Request implements ArrayAccess {
}
$value = strtolower( $value );
if ( false === strpos( $value, '/' ) ) {
if ( ! str_contains( $value, '/' ) ) {
return null;
}
@@ -473,8 +473,10 @@ class WP_REST_Request implements ArrayAccess {
$params = array();
foreach ( $order as $type ) {
// array_merge() / the "+" operator will mess up
// numeric keys, so instead do a manual foreach.
/*
* array_merge() / the "+" operator will mess up
* numeric keys, so instead do a manual foreach.
*/
foreach ( (array) $this->params[ $type ] as $key => $value ) {
$params[ $key ] = $value;
}
@@ -1031,7 +1033,7 @@ class WP_REST_Request implements ArrayAccess {
}
$api_root = rest_url();
if ( get_option( 'permalink_structure' ) && 0 === strpos( $url, $api_root ) ) {
if ( get_option( 'permalink_structure' ) && str_starts_with( $url, $api_root ) ) {
// Pretty permalinks on, and URL is under the API root.
$api_url_part = substr( $url, strlen( untrailingslashit( $api_root ) ) );
$route = parse_url( $api_url_part, PHP_URL_PATH );