WordPress.org

Make WordPress Core

Changeset 50576


Ignore:
Timestamp:
03/25/2021 12:37:49 PM (7 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.

Location:
trunk/src/wp-includes
Files:
2 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
  • trunk/src/wp-includes/class-wp-query.php

    r50565 r50576  
    25992599        if ( $this->is_comment_feed && ! $this->is_singular ) {
    26002600            if ( $this->is_archive || $this->is_search ) {
    2601                 $cjoin    = "JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) $join ";
     2601                $cjoin    = "JOIN {$wpdb->posts} ON ( {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID ) $join ";
    26022602                $cwhere   = "WHERE comment_approved = '1' $where";
    26032603                $cgroupby = "{$wpdb->comments}.comment_id";
Note: See TracChangeset for help on using the changeset viewer.