WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 2 months ago

#49279 new enhancement

Missing spaces

Reported by: jillebehm Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3.2
Component: Query Keywords: dev-feedback good-first-bug has-patch
Focuses: coding-standards Cc:

Description (last modified by SergeyBiryukov)

In /wp-includes/class-wp-meta-query.php on line 563 and 565 a space is missing between the opening parenthesis and $this->primary_table. This is not really a big thing, but the space is there in all the other code that use parentheses.

I noticed this when I tried to parse the JOIN statements mentioned in #49278, since I couldn't parse the correct 'words', because the parenthesis is now part of a 'word instead of a separate 'word'.

if ( 'LIKE' === $meta_compare_key ) {
	$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'] ) . '%' );
} else {
	$join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] );
}

Attachments (1)

49279.2.patch (1.1 KB) - added by kaavyaiyer 2 months ago.
Added missing spaces

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
11 months ago

  • Description modified (diff)

#2 @Hareesh Pillai
3 months ago

  • Keywords good-first-bug added

@kaavyaiyer
2 months ago

Added missing spaces

#3 @kaavyaiyer
2 months ago

  • Keywords has-patch added

Hi! I have added the missing spaces in /wp-includes/class-wp-meta-query.php. Please let me know if the changes look good.

#4 @Hareesh Pillai
2 months ago

Thanks for the patch @kaavyaiyer. The patch looks good to me.

Note: See TracTickets for help on using tickets.