RE: [Mrbs-general] Interesting bug in mincals.inc
Brought to you by:
jberanek
From: Sam M. <sm...@mt...> - 2000-08-07 08:07:59
|
This was fixed a little while ago (0.8-pre6 onwards), thanks for the info though. Any other wierdos? Thanks, Sam. > -----Original Message----- > From: Green, Bob [mailto:Gr...@lo...] > Sent: Friday, August 04, 2000 4:55 PM > To: 'Sam Mason'; Mrb...@li... > Subject: [Mrbs-general] Interesting bug in mincals.inc > > > Hi, > > I just tripped over a neat bug in mincals.inc. The best way > to demonstrate > it is to pull up the diary for 29th April 2000. You will > notice that the > previous and next months (Feb and Apr) are correct. Now click > on 30th March > and see what happens to Feb. Next click on 31st March and see > what happens > to April!!! > > The problem is triggered when the next or previous months > have fewer days in > them than the current date in the current month. Here's a fix: > > In mincals.inc: > 148c148 > < $lastmonth = mktime(0, 0, 0, $month-1, 1, $year); > --- > > $lastmonth = mktime(0, 0, 0, $month-1, $day, $year); > 150c150 > < $nextmonth = mktime(0, 0, 0, $month+1, 1, $year); > --- > > $nextmonth = mktime(0, 0, 0, $month+1, $day, $year); > > This ensures that the calculation of the next and previous > month picks up > the correct month. From my brief look at the code I can't see > that it is > going to break anything. Be warned though, I am VERY new to > PHP, though not > to programming, so I might have missed something obvious. > > Share and enjoy... > > -Bob > > _______________________________________________ > Mrbs-general mailing list > Mrb...@li... > http://lists.sourceforge.net/mailman/listinfo/mrbs-general > |