Skip to content

Commit

Permalink
Query: Improve sanitization within WP_Meta_Query.
Browse files Browse the repository at this point in the history
Props vortfu, xknown, dd32.

git-svn-id: https://develop.svn.wordpress.org/trunk@52455 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Jan 6, 2022
1 parent e0ff6d8 commit 8dd5aec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-meta-query.php
Expand Up @@ -848,7 +848,7 @@ protected function find_compatible_table_alias( $clause, $parent_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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-tax-query.php
Expand Up @@ -527,7 +527,7 @@ protected function find_compatible_table_alias( $clause, $parent_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;
}
}
Expand Down

0 comments on commit 8dd5aec

Please sign in to comment.