[wp-trac] Re: [WordPress Trac] #3944: Entering an invalid post timestamp will be tolerated and results in bad view links

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 10 15:12:04 GMT 2007


#3944: Entering an invalid post timestamp will be tolerated and results in bad
view links
----------------------------------------+-----------------------------------
 Reporter:  erikwasser                  |        Owner:  anonymous
     Type:  defect                      |       Status:  new      
 Priority:  low                         |    Milestone:  2.2      
Component:  Administration              |      Version:  2.1.2    
 Severity:  normal                      |   Resolution:           
 Keywords:  has-patch admin write post  |  
----------------------------------------+-----------------------------------
Comment (by jhodgdon):

 OK, I tested this idea of patching get_permalink.

 a) Reverted admin_functions.php to version [5007] (without the above
 patch), so that I could create a post_date that was invalid.

 b) Created a post with an invalid date (April 31). The permalink doesn't
 work (as described above), as the permalink has a date of May 1, and the
 database has April 31, so when you click the permalink, it cannot find the
 post in the database.

 c) Applied a new patch (coming soon) to the get_permalink function to use
 the database-stored month/day/year instead of converting to a valid
 date/time first.

 d) Now the permalink says April 31, and it works! Permalinks on posts with
 valid dates are not affected.

 So... I am not sure whether I would recommend installing this patch or
 not, but it does work, and should match what the querying logic is doing
 more closely.

 It does lead to some odd behavior. Such as that now I have an archive for
 April 2006 in my monthly archives list on the sidebar. When I click on
 that archive, it does show my post (which is good), but the title of the
 archive says "Archive for May 2006", and the date of the post (displayed
 with the_date) says May 1, 2006.

 Then again, it is an invalid date, so we would expect some things to be
 broken. But at least the permalinks are clickable (i.e. consistent with
 the query).

 And I don't think it will break anyone's existing permalinks, because
 permalinks that were previously inconsistent with the query structure
 would have been broken anyway.

 Well, I'll submit the patch and let you think about whether to install it
 or not.

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


More information about the wp-trac mailing list