On Mon, 5 Dec 2005, Ilia Alshanetsky wrote: > iliaa Mon Dec 5 12:27:04 2005 EDT > > Modified files: (Branch: PHP_5_1) > /php-src/ext/date/tests mktime-3.phpt > /php-src/ext/date php_date.c > /php-src NEWS > Log: > Fixed bug #35558 (mktime() interpreting 3 digit years incorrectly).
Sorry, but this is incorrect. The previous behavior was broken. The code now implemented what the documentation actually wrote. Please revert this. Derick > http://cvs.php.net/diff.php/php-src/ext/date/tests/mktime-3.phpt?r1=1.1.2.2&r2=1.1.2.3&ty=u > Index: php-src/ext/date/tests/mktime-3.phpt > diff -u php-src/ext/date/tests/mktime-3.phpt:1.1.2.2 > php-src/ext/date/tests/mktime-3.phpt:1.1.2.3 > --- php-src/ext/date/tests/mktime-3.phpt:1.1.2.2 Sun Nov 27 01:51:43 2005 > +++ php-src/ext/date/tests/mktime-3.phpt Mon Dec 5 12:27:01 2005 > @@ -5,7 +5,7 @@ > --FILE-- > <?php > $tzs = array("America/Toronto", "Europe/Oslo"); > -$years = array(0, 69, 70, 71, 99, 100, 1900, 1901, 1902, 1999, 2000, 2001); > +$years = array(0, 69, 70, 71, 99, 100, 105, 1900, 1901, 1902, 1999, 2000, > 2001); > > foreach ($tzs as $tz) { > echo $tz, "\n"; > @@ -30,6 +30,7 @@ > Y: 71 - January 1971-01-01T01:01:01-0500 > Y: 99 - January 1999-01-01T01:01:01-0500 > Y: 100 - January 2000-01-01T01:01:01-0500 > +Y: 105 - January 2005-01-01T01:01:01-0500 > Y: 1900 - out of range > Y: 1901 - out of range > Y: 1902 - January 1902-01-01T01:01:01-0500 > @@ -44,6 +45,7 @@ > Y: 71 - January 1971-01-01T01:01:01+0100 > Y: 99 - January 1999-01-01T01:01:01+0100 > Y: 100 - January 2000-01-01T01:01:01+0100 > +Y: 105 - January 2005-01-01T01:01:01+0100 > Y: 1900 - out of range > Y: 1901 - out of range > Y: 1902 - January 1902-01-01T01:01:01+0100 > http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.29&r2=1.43.2.30&ty=u > Index: php-src/ext/date/php_date.c > diff -u php-src/ext/date/php_date.c:1.43.2.29 > php-src/ext/date/php_date.c:1.43.2.30 > --- php-src/ext/date/php_date.c:1.43.2.29 Thu Dec 1 11:24:43 2005 > +++ php-src/ext/date/php_date.c Mon Dec 5 12:27:02 2005 > @@ -16,7 +16,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: php_date.c,v 1.43.2.29 2005/12/01 16:24:43 iliaa Exp $ */ > +/* $Id: php_date.c,v 1.43.2.30 2005/12/05 17:27:02 iliaa Exp $ */ > > #include "php.h" > #include "php_streams.h" > @@ -860,7 +860,7 @@ > case 6: > if (yea >= 0 && yea < 70) { > yea += 2000; > - } else if (yea >= 70 && yea <= 100) { > + } else if (yea >= 70 && yea <= 110) { > yea += 1900; > } > now->y = yea; > http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.274&r2=1.2027.2.275&ty=u > Index: php-src/NEWS > diff -u php-src/NEWS:1.2027.2.274 php-src/NEWS:1.2027.2.275 > --- php-src/NEWS:1.2027.2.274 Mon Dec 5 08:16:48 2005 > +++ php-src/NEWS Mon Dec 5 12:27:02 2005 > @@ -21,6 +21,7 @@ > - Fixed many bugs in OCI8. (Tony) > - Fixed crash and leak in mysqli when using 4.1.x client libraries and > connecting to 5.x server. (Andrey) > +- Fixed bug #35558 (mktime() interpreting 3 digit years incorrectly). (Ilia) > - Fixed bug #35543 (php crash when calling non existing method of a class > that extends PDO). (Tony) > - Fixed bug #35539 (typo in error message for ErrorException). (Tony) > > -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php