WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/25/2021 12:37:49 PM (8 months ago)
Author:
SergeyBiryukov
Message:

Query: Consistently include a space in parentheses in WP_Meta_Query::get_sql_for_clause().

Props jillebehm, kaavyaiyer, hareesh-pillai.
Fixes #49279.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-meta-query.php

    r49927 r50576  
    561561
    562562                if ( 'LIKE' === $meta_compare_key ) {
    563                     $join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key LIKE %s )", '%' . $wpdb->esc_like( $clause['key'] ) . '%' );
     563                    $join .= $wpdb->prepare( " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key LIKE %s )", '%' . $wpdb->esc_like( $clause['key'] ) . '%' );
    564564                } else {
    565                     $join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] );
     565                    $join .= $wpdb->prepare( " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] );
    566566                }
    567567
Note: See TracChangeset for help on using the changeset viewer.