diff options
author | Derick Rethans <derick@php.net> | 2008-12-02 18:01:58 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2008-12-02 18:01:58 +0000 |
commit | 24a764e0860be7f28537265ca35012706ba74a9f (patch) | |
tree | 41c3dfec407bb5331209863f4d0976137ffa046e | |
parent | 7c53e812737d80a236d92297594177e57aeb375b (diff) | |
download | php-git-24a764e0860be7f28537265ca35012706ba74a9f.tar.gz |
- MFH: Fixed bug #46732 (mktime.year description is wrong).
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/date/php_date.c | 2 | ||||
-rw-r--r-- | ext/date/tests/mktime-3-64bit.phpt | 10 |
3 files changed, 9 insertions, 4 deletions
@@ -5,6 +5,7 @@ PHP NEWS reported by Maksymilian Arciemowicz. (Stas) - Fixed bug #46366 (bad cwd with / as pathinfo). (Dmitry) +- Fixed bug #46732 (mktime.year description is wrong). (Derick) 27 Nov 2008, PHP 5.2.7RC5 - Upgraded PCRE to version 7.8 (Fixes CVE-2008-2371) (Ilia) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 8943d24006..f50c0380b3 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1188,7 +1188,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt) case 6: if (yea >= 0 && yea < 70) { yea += 2000; - } else if (yea >= 70 && yea <= 110) { + } else if (yea >= 70 && yea <= 100) { yea += 1900; } now->y = yea; diff --git a/ext/date/tests/mktime-3-64bit.phpt b/ext/date/tests/mktime-3-64bit.phpt index bb3fb2df74..a3649cd148 100644 --- a/ext/date/tests/mktime-3-64bit.phpt +++ b/ext/date/tests/mktime-3-64bit.phpt @@ -7,7 +7,7 @@ error_reporting=2047 --FILE-- <?php $tzs = array("America/Toronto", "Europe/Oslo"); -$years = array(0, 69, 70, 71, 99, 100, 105, 1900, 1901, 1902, 1999, 2000, 2001); +$years = array(0, 69, 70, 71, 99, 100, 101, 105, 110, 1900, 1901, 1902, 1999, 2000, 2001); foreach ($tzs as $tz) { echo $tz, "\n"; @@ -32,7 +32,9 @@ Y: 70 - January 1970-01-01T01:01:01-0500 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: 101 - January 0101-01-01T01:01:01-0500 +Y: 105 - January 0105-01-01T01:01:01-0500 +Y: 110 - January 0110-01-01T01:01:01-0500 Y: 1900 - January 1900-01-01T01:01:01-0500 Y: 1901 - January 1901-01-01T01:01:01-0500 Y: 1902 - January 1902-01-01T01:01:01-0500 @@ -47,7 +49,9 @@ Y: 70 - January 1970-01-01T01:01:01+0100 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: 101 - January 0101-01-01T01:01:01+0100 +Y: 105 - January 0105-01-01T01:01:01+0100 +Y: 110 - January 0110-01-01T01:01:01+0100 Y: 1900 - January 1900-01-01T01:01:01+0100 Y: 1901 - January 1901-01-01T01:01:01+0100 Y: 1902 - January 1902-01-01T01:01:01+0100 |