REST API: JavaScript client should use _.extend when merging objects.

Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects.

Props ketuchetan.
Fixes #39341.


Built from https://develop.svn.wordpress.org/trunk@40040


git-svn-id: http://core.svn.wordpress.org/trunk@39977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2017-02-03 21:46:43 +00:00
parent 8f855f46b0
commit 717aeab3cc
3 changed files with 4 additions and 4 deletions

View File

@ -185,7 +185,7 @@
} else {
// We already have args, merge these new args in.
modelInstance.prototype.args = _.union( routeEndpoint.args, modelInstance.prototype.defaults );
modelInstance.prototype.args = _.extend( modelInstance.prototype.args, routeEndpoint.args );
}
}
} else {
@ -202,7 +202,7 @@
} else {
// We already have options, merge these new args in.
modelInstance.prototype.options = _.union( routeEndpoint.args, modelInstance.prototype.options );
modelInstance.prototype.options = _.extend( modelInstance.prototype.options, routeEndpoint.args );
}
}

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40039';
$wp_version = '4.8-alpha-40040';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.