Skip to content

Commit

Permalink
Query: Improve sanitization within WP_Tax_Query.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
desrosj committed Jan 6, 2022
1 parent a02b777 commit 271b1f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion wp-includes/class-wp-tax-query.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -556,7 +556,11 @@ private function clean_query( &$query ) {
return; return;
} }


$query['terms'] = array_unique( (array) $query['terms'] ); if ( 'slug' === $query['field'] || 'name' === $query['field'] ) {
$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' );
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 271b1f6

Please sign in to comment.