Make WordPress Core

Changeset 52454


Ignore:
Timestamp:
01/06/2022 05:01:11 PM (3 years ago)
Author:
desrosj
Message:

Query: Improve sanitization within WP_Tax_Query.

Props dd32, xknown, peterwilsoncc, ehtis.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-tax-query.php

    r52332 r52454  
    557557        }
    558558
    559         $query['terms'] = array_unique( (array) $query['terms'] );
     559        if ( 'slug' === $query['field'] || 'name' === $query['field'] ) {
     560            $query['terms'] = array_unique( (array) $query['terms'] );
     561        } else {
     562            $query['terms'] = wp_parse_id_list( $query['terms'] );
     563        }
    560564
    561565        if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) {
Note: See TracChangeset for help on using the changeset viewer.