mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-13 06:07:23 +01:00
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:
parent
6f7032dcf4
commit
7d20ea9c50
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user