Query: Improve sanitization within `WP_Tax_Query`.

Props dd32, xknown, peterwilsoncc, ehtis.
Built from https://develop.svn.wordpress.org/trunk@52454


git-svn-id: http://core.svn.wordpress.org/trunk@52046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2022-01-06 17:03:05 +00:00
parent a02b7770f4
commit 271b1f60cd
2 changed files with 6 additions and 2 deletions

View File

@ -556,7 +556,11 @@ class WP_Tax_Query {
return; return;
} }
if ( 'slug' === $query['field'] || 'name' === $query['field'] ) {
$query['terms'] = array_unique( (array) $query['terms'] ); $query['terms'] = array_unique( (array) $query['terms'] );
} else {
$query['terms'] = wp_parse_id_list( $query['terms'] );
}
if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) { if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) {
$this->transform_query( $query, 'term_id' ); $this->transform_query( $query, 'term_id' );

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.0-alpha-52453'; $wp_version = '6.0-alpha-52454';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.