When saving post, ensure that non-hierarchical taxonomy input is defined before attempting to parse it.

Taxonomy metaboxes that are disabled for the current user are included in the
post.php markup, but do not contain the 'newtag' field, and so should be
skipped when looping through the metaboxes to avoid invoking String methods
on a variable of type `undefined`.

Props MikeNGarrett, A5hleyRich.
Fixes #30859.

git-svn-id: https://develop.svn.wordpress.org/trunk@31895 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2015-03-26 01:22:01 +00:00
parent fed67453a1
commit 5d50b55c7e
1 changed files with 5 additions and 0 deletions

View File

@ -112,6 +112,11 @@ var tagBox, array_unique_noempty;
a = a || false;
text = a ? $(a).text() : newtag.val();
if ( 'undefined' == typeof( text ) ) {
return false;
}
tagsval = tags.val();
newtags = tagsval ? tagsval + comma + text : text;