Improve WP_Tax_Query param sanitization for empty strings.

When an empty string is passed as one of the clauses in the `$tax_query`
parameter, it should be discarded rather than parsed as a first-order clause.

Props tmtrademark.
Fixes #30117.
Built from https://develop.svn.wordpress.org/trunk@30031


git-svn-id: http://core.svn.wordpress.org/trunk@30031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2014-10-26 22:57:18 +00:00
parent 524097970a
commit 61115c51f7
2 changed files with 2 additions and 2 deletions

View File

@ -832,7 +832,7 @@ class WP_Tax_Query {
* @return bool Whether the query clause is a first-order clause.
*/
protected static function is_first_order_clause( $query ) {
return empty( $query ) || array_key_exists( 'terms', $query ) || array_key_exists( 'taxonomy', $query ) || array_key_exists( 'include_children', $query ) || array_key_exists( 'field', $query ) || array_key_exists( 'operator', $query );
return is_array( $query ) && ( empty( $query ) || array_key_exists( 'terms', $query ) || array_key_exists( 'taxonomy', $query ) || array_key_exists( 'include_children', $query ) || array_key_exists( 'field', $query ) || array_key_exists( 'operator', $query ) );
}
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-alpha-30030';
$wp_version = '4.1-alpha-30031';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.