SQL Error on feeds for invalid posts
|Reported by:||robertaccettura||Owned by:||anonymous|
|Severity:||normal||Keywords:||sql error feed query.php needs-patch|
If you append /feed to an invalid post url (the post itself returns a 404), you get a SQL error on top:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 10' at line 1]
SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 10
Looks like it's coming from get_posts() in wp-includes/query.php
Calling this major since it breaks the feed.
Google webmaster's console is even weirder. When a redirect points to a feed broken like this, it shows up as a 404.
Change History (24)
- Keywords invalid removed
- Owner changed from anonymous to pishmishy
comment:21 pishmishy — 6 years ago
- Owner changed from pishmishy to anonymous
- Status changed from assigned to new