Make WordPress Core

Changeset 31895


Ignore:
Timestamp:
03/26/2015 01:22:01 AM (10 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/tags-box.js

    r31675 r31895  
    113113
    114114            text = a ? $(a).text() : newtag.val();
     115
     116            if ( 'undefined' == typeof( text ) ) {
     117                return false;
     118            }
     119
    115120            tagsval = tags.val();
    116121            newtags = tagsval ? tagsval + comma + text : text;
Note: See TracChangeset for help on using the changeset viewer.