Query: Improve sanitization within `WP_Meta_Query`.

Merges [52455] to the 5.8 branch.
Props vortfu, xknown, dd32.
Built from https://develop.svn.wordpress.org/branches/5.8@52461


git-svn-id: http://core.svn.wordpress.org/branches/5.8@52053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2022-01-06 17:25:00 +00:00
parent 6f7032dcf4
commit 7d20ea9c50
2 changed files with 2 additions and 2 deletions

View File

@ -812,7 +812,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;
}
}