Query: Improve sanitization within WP_Meta_Query.

Merges [52455] to the 5.9 branch.
Props vortfu, xknown, dd32.

git-svn-id: https://develop.svn.wordpress.org/branches/5.9@52460 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2022-01-06 17:21:51 +00:00
parent abb893a104
commit 73421fa84f
2 changed files with 2 additions and 2 deletions

View File

@ -848,7 +848,7 @@ class WP_Meta_Query {
$clause_compare = strtoupper( $clause['compare'] );
$sibling_compare = strtoupper( $sibling['compare'] );
if ( in_array( $clause_compare, $compatible_compares, true ) && in_array( $sibling_compare, $compatible_compares, true ) ) {
$alias = $sibling['alias'];
$alias = preg_replace( '/\W/', '_', $sibling['alias'] );
break;
}
}

View File

@ -527,7 +527,7 @@ class WP_Tax_Query {
// The sibling must both have compatible operator to share its alias.
if ( in_array( strtoupper( $sibling['operator'] ), $compatible_operators, true ) ) {
$alias = $sibling['alias'];
$alias = preg_replace( '/\W/', '_', $sibling['alias'] );
break;
}
}