Make WordPress Core


Ignore:
Timestamp:
12/03/2016 05:08:33 AM (10 years ago)
Author:
pento
Message:

REST API: Capability check for editing a single term should use the singular form.

As an extra level of sanity checking, the term ID should be cast as an int in map_meta_cap().

Merge of [39464] to the 4.7 branch.

Props johnbillion, nacin, dd32, pento.
See #35614.
Fixes #39012.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/capabilities.php

    r39179 r39465  
    428428        case 'delete_term':
    429429        case 'assign_term':
    430                 $term_id = $args[0];
     430                $term_id = (int) $args[0];
    431431                $term = get_term( $term_id );
    432432                if ( ! $term || is_wp_error( $term ) ) {
Note: See TracChangeset for help on using the changeset viewer.