mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #38229 (strtotime() does not parse YYYY-MM format).
This commit is contained in:
parent
92f4cc359f
commit
af48ecfc87
1
NEWS
1
NEWS
@ -16,6 +16,7 @@ PHP NEWS
|
||||
compatibility issue). (Patch: scott dot moynes+php at gmail dot com)
|
||||
|
||||
- Fixed bug #38234 (Exception in __clone makes memory leak). (Dmitry, Nuno)
|
||||
- Fixed bug #38229 (strtotime() does not parse YYYY-MM format). (Ilia)
|
||||
- Fixed bug #38220 (Crash on some object operations). (Dmitry)
|
||||
- Fixed bug #38217 (ReflectionClass::newInstanceArgs() tries to allocate too
|
||||
much memory). (Tony)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -829,6 +829,7 @@ americanshort = month "/" day;
|
||||
american = month "/" day "/" year;
|
||||
iso8601dateslash = year4 "/" monthlz "/" daylz "/"?;
|
||||
dateslash = year4 "/" month "/" day;
|
||||
gnudateshorter = year4 "-" month;
|
||||
gnudateshort = year "-" month "-" day;
|
||||
iso8601date = year4 "-" monthlz "-" daylz;
|
||||
pointeddate = day [.\t-] month [.-] year;
|
||||
@ -1094,6 +1095,18 @@ relativetext = reltextnumber space reltextunit;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
|
||||
gnudateshorter
|
||||
{
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->m = timelib_get_nr((char **) &ptr, 2);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
|
||||
gnudateshort
|
||||
{
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
|
13
ext/date/tests/bug38229.phpt
Normal file
13
ext/date/tests/bug38229.phpt
Normal file
@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #38229 (strtotime() does not parse YYYY-MM)
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set("GMT");
|
||||
echo date("Y-m", strtotime('2006-1'))."\n";
|
||||
echo date("Y-m", strtotime('2006-03'))."\n";
|
||||
echo date("Y-m", strtotime('2006-12'))."\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
2006-01
|
||||
2006-03
|
||||
2006-12
|
Loading…
Reference in New Issue
Block a user