[wp-trac] [WordPress Trac] #5490: Bad post URL gives database error instead of 404

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 19 18:24:04 GMT 2007


#5490: Bad post URL gives database error instead of 404
---------------------+------------------------------------------------------
 Reporter:  Bobcat   |       Owner:  anonymous
     Type:  defect   |      Status:  new      
 Priority:  normal   |   Milestone:  2.5      
Component:  General  |     Version:  2.3.1    
 Severity:  normal   |    Keywords:           
---------------------+------------------------------------------------------
 If I enter a URL such as !http://www.example.com/blog/2007/12/unknown/
 where there is no such post, I expect to get a 404 error.  Instead, I get
 the following database error:

 !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 'ORDER BY p.post_date ASC LIMIT 1' at line 1][[BR]]
 SELECT p.ID, p.post_title FROM wp_posts AS p WHERE p.post_date > !'' AND
 p.post_type = 'post' AND p.post_status = 'publish' AND p.ID != ORDER BY
 p.post_date ASC LIMIT 1

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5490>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list