mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-10 12:50:18 +01:00
REST API: Change method of merging parameters.
`array_merge()` incorrectly reindexes numeric parameters, causing things like `{"123": true}` to be "dropped". Props sswells, joehoyle. Fixes #38306. Built from https://develop.svn.wordpress.org/trunk@39087 git-svn-id: http://core.svn.wordpress.org/trunk@39029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dab566d973
commit
d7bdd72510
@ -451,7 +451,11 @@ class WP_REST_Request implements ArrayAccess {
|
|||||||
|
|
||||||
$params = array();
|
$params = array();
|
||||||
foreach ( $order as $type ) {
|
foreach ( $order as $type ) {
|
||||||
$params = array_merge( $params, (array) $this->params[ $type ] );
|
// 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $params;
|
return $params;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-beta1-39086';
|
$wp_version = '4.7-beta1-39087';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user