rebase on oct-10-2023
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user