Make WordPress Core

Changeset 52461 for branches/5.8


Ignore:
Timestamp:
01/06/2022 05:22:56 PM (2 years ago)
Author:
desrosj
Message:

Query: Improve sanitization within WP_Meta_Query.

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

Location:
branches/5.8
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/class-wp-meta-query.php

    r50576 r52461  
    813813            $sibling_compare = strtoupper( $sibling['compare'] );
    814814            if ( in_array( $clause_compare, $compatible_compares, true ) && in_array( $sibling_compare, $compatible_compares, true ) ) {
    815                 $alias = $sibling['alias'];
     815                $alias = preg_replace( '/\W/', '_', $sibling['alias'] );
    816816                break;
    817817            }
  • branches/5.8/src/wp-includes/class-wp-tax-query.php

    r52459 r52461  
    528528            // The sibling must both have compatible operator to share its alias.
    529529            if ( in_array( strtoupper( $sibling['operator'] ), $compatible_operators, true ) ) {
    530                 $alias = $sibling['alias'];
     530                $alias = preg_replace( '/\W/', '_', $sibling['alias'] );
    531531                break;
    532532            }
Note: See TracChangeset for help on using the changeset viewer.