[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
Wed Dec 19 19:18:33 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.4      
Component:  Administration                    |      Version:  2.1.2    
 Severity:  normal                            |   Resolution:           
 Keywords:  has-patch admin write post early  |  
----------------------------------------------+-----------------------------
Comment (by santosj):

 The modulus gives the reminder (if you didn't already know)

 So for 0-23, it will give you 0-23. When you have more than that then it
 will start returning the reminder.

 {{{
 24 = 0 which is right, because it would be the next day.
 25 = 1 which is correct since 25-24 = 1.
 }}}
 {{{
 48 = 0
 49 = 1
 }}}

 ... so on.

 It would be better since if someone enters a number higher than 48, then
 it will return a value greater than 24, which is incorrect. Doing a while
 look is inefficient, since the modulus does everything you need. If you
 wanted to advance the day, then a while loop would be better, but you
 could just use an divide to get how many days should be advanced.

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


More information about the wp-trac mailing list