Don't parse empty 'tax_input' keys in edit_post().

This fixes a bug introduced in [31359] where saving a tax_input that contained
only whitespace would result in a random tag being erroneously added to the
post.

See #30615.
Built from https://develop.svn.wordpress.org/trunk@31392


git-svn-id: http://core.svn.wordpress.org/trunk@31373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2015-02-09 22:54:28 +00:00
parent 980668299c
commit 72f18cb067
2 changed files with 6 additions and 1 deletions

View File

@ -337,6 +337,11 @@ function edit_post( $post_data = null ) {
$clean_terms = array(); $clean_terms = array();
foreach ( $terms as $term ) { foreach ( $terms as $term ) {
// Empty terms are invalid input.
if ( empty( $term ) ) {
continue;
}
$_term = get_terms( $taxonomy, array( $_term = get_terms( $taxonomy, array(
'name' => $term, 'name' => $term,
'fields' => 'ids', 'fields' => 'ids',

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-alpha-31391'; $wp_version = '4.2-alpha-31392';
/** /**
* 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.