Make WordPress Core

Changeset 52458


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

Query: Improve sanitization within WP_Tax_Query.

Merges [52454] to the 5.9 branch.
Props dd32, xknown, peterwilsoncc, ehtis.

Location:
branches/5.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

    • Property svn:mergeinfo changed
      /trunk (added)merged: 52454
  • branches/5.9/src/wp-includes/class-wp-tax-query.php

    r52332 r52458  
    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.