[wp-trac] [WordPress Trac] #10935: WP_Query and is_day() bug

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 9 05:05:25 UTC 2009


#10935: WP_Query and is_day() bug
--------------------------+-------------------------------------------------
 Reporter:  raliste       |       Owner:  ryan 
     Type:  defect (bug)  |      Status:  new  
 Priority:  normal        |   Milestone:       
Component:  Query         |     Version:  2.8.4
 Severity:  major         |    Keywords:       
--------------------------+-------------------------------------------------
 When you configure Wordpress with permalinks such as /%year%/%month% and
 even /%year%/%month%/%day/ there is
 a failure when you request URLs like /2009/10/58, because it's still
 generating the query to the database
 (AND YEAR(wp_posts.post_date)='2009' AND MONTH(wp_posts.post_date)='10'
 AND DAYOFMONTH(wp_posts.post_date)='58').
 Also, is_day() returns true, when it should be returning false.

 As adding a post with that date is nearly impossible trough the wordpress
 admin or the database, no posts will be found, so
 Wordpress will show "No page found", but with HTTP status 200 OK, not 404
 Not Found.

 I think it's important to validate the day on the applicacion side, so for
 some ideas to work correctly under WP
 (like take advantage of sticky posts and show all post for the month in
 day requests), and most importantly to save
 those wasted mysql queries.

 Of course I could validate the day using a filter, but that is not the
 general idea!

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


More information about the wp-trac mailing list