Make WordPress Core

Ticket #46350: 46350.patch

File 46350.patch, 1.2 KB (added by clescuyer, 5 years ago)
  • src/wp-includes/class-wp-query.php

    diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
    index 953f917d27..e8b653357d 100644
    a b class WP_Query { 
    10961096                                continue;   // Handled further down in the $q['tag'] block
    10971097                        }
    10981098
    1099                         if ( $t->query_var && ! empty( $q[ $t->query_var ] ) ) {
     1099                        if ( $t->query_var && isset( $q[ $t->query_var ] ) && '' != $q[ $t->query_var ] ) {
    11001100                                $tax_query_defaults = array(
    11011101                                        'taxonomy' => $taxonomy,
    11021102                                        'field'    => 'slug',
  • src/wp-includes/class-wp-tax-query.php

    diff --git a/src/wp-includes/class-wp-tax-query.php b/src/wp-includes/class-wp-tax-query.php
    index 03e904c670..4f6ccfb564 100644
    a b class WP_Tax_Query { 
    601601                $resulting_field = sanitize_key( $resulting_field );
    602602
    603603                // Empty 'terms' always results in a null transformation.
    604                 $terms = array_filter( $query['terms'] );
     604                $terms = array_filter( $query['terms'], function( $term ) { return ( 0 !== strlen( trim( $term ) ) ); } );
    605605                if ( empty( $terms ) ) {
    606606                        $query['terms'] = array();
    607607                        $query['field'] = $resulting_field;