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

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 8 05:32:33 UTC 2012


#10935: WP_Query and is_day() bug
--------------------------+-----------------------------
 Reporter:  raliste       |       Owner:  ryan
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Canonical     |     Version:  2.8.4
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------------
Changes (by wonderboymusic):

 * keywords:  needs-patch => has-patch
 * component:  Query => Canonical


Comment:

 If you pass an invalid date to {{{WP_Query}}}, it will fire a query that
 will fail and then 404. My patch 404s before the query is made and does
 canonical redirection on bad date URLs.

 If it's a day url, and the day doesn't jive with the month: it will
 redirect to the month. If it's a month url, and the {{{monthnum}}} is 15
 or something: it will redirect to the year.

 Adds 2 functions: {{{wp_is_valid_day()}}} and {{{wp_is_valid_month()}}}

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


More information about the wp-trac mailing list