Merge pull request from GHSA-6hq4-w6wv-8wrp

This commit is contained in:
Darren Ethier 2021-07-14 16:55:12 -04:00 committed by GitHub
parent 47c38f4548
commit e0053afd6a
1 changed files with 7 additions and 1 deletions

View File

@ -83,7 +83,13 @@ class ProductQueryFilters {
$attributes = array_map( 'wc_attribute_taxonomy_name_by_id', wp_parse_id_list( $attributes ) );
}
$attributes_to_count = array_map( 'wc_sanitize_taxonomy_name', $attributes );
$attributes_to_count = array_map(
function( $attribute ) {
$attribute = wc_sanitize_taxonomy_name( $attribute );
return esc_sql( $attribute );
},
$attributes
);
$attributes_to_count_sql = 'AND term_taxonomy.taxonomy IN ("' . implode( '","', $attributes_to_count ) . '")';
$attribute_count_sql = "
SELECT COUNT( DISTINCT posts.ID ) as term_count, terms.term_id as term_count_id