From 0b67b638572c8610dddb86b6dd81aff70e08aa65 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 1 Sep 2016 05:10:07 +0000 Subject: [PATCH] Query: Use `AND` in a SQL query rather than `&&`. This appears to have been the only instance of `&&` being used in SQL, so for consistency lets remove it. Props scrappy@hub.org. Fixes #37903. git-svn-id: https://develop.svn.wordpress.org/trunk@38491 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index 0ca0572b9d..95904060ce 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -2411,7 +2411,7 @@ class WP_Query { $cgroupby = "{$this->db->comments}.comment_id"; } else { // Other non singular e.g. front $cjoin = "JOIN {$this->db->posts} ON ( {$this->db->comments}.comment_post_ID = {$this->db->posts}.ID )"; - $cwhere = "WHERE ( post_status = 'publish' OR ( post_status = 'inherit' && post_type = 'attachment' ) ) AND comment_approved = '1'"; + $cwhere = "WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) ) AND comment_approved = '1'"; $cgroupby = ''; }