Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Comments collection accidentally generates a search query #2255

@rmccue

Description

@rmccue

We default search to null, but internally, WP_Comment_Query checks that it's an empty string. This generates a search query which looks like:

SELECT SQL_CALC_FOUND_ROWS sz_comments.comment_ID
FROM sz_comments
WHERE ( comment_approved = '1' )
AND comment_post_ID IN ( 85 )
AND comment_type IN ('')
AND (comment_author LIKE '%%'
OR comment_author_email LIKE '%%'
OR comment_author_url LIKE '%%'
OR comment_author_IP LIKE '%%'
OR comment_content LIKE '%%')
ORDER BY sz_comments.comment_date_gmt ASC, sz_comments.comment_ID ASC
LIMIT 10

🙉

Core needs to be patched to have a better check, but we should work around this in the meantime.

cc @rachelbaker our comment overlord

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions