mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
- Fixed bug #52430 (date_parse parse 24:xx:xx as valid time). (Derick)
This commit is contained in:
parent
fcc22c6af3
commit
1fc5e47fb6
3 changed files with 143 additions and 98 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Generated by re2c 0.13.5 on Fri Mar 26 12:26:56 2010 */
|
||||
/* Generated by re2c 0.13.5 on Mon Aug 30 17:33:15 2010 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
|
@ -843,11 +843,11 @@ static int scan(Scanner *s)
|
|||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 967 "ext/date/lib/parse_date.re"
|
||||
#line 969 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 849 "ext/date/lib/parse_date.c"
|
||||
#line 851 "ext/date/lib/parse_date.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
|
@ -967,7 +967,7 @@ std:
|
|||
}
|
||||
yy2:
|
||||
YYDEBUG(2, *YYCURSOR);
|
||||
#line 1052 "ext/date/lib/parse_date.re"
|
||||
#line 1054 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
|
@ -983,7 +983,7 @@ yy2:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 985 "ext/date/lib/parse_date.c"
|
||||
#line 987 "ext/date/lib/parse_date.c"
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
|
@ -1006,7 +1006,7 @@ yy3:
|
|||
}
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
#line 1634 "ext/date/lib/parse_date.re"
|
||||
#line 1636 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
|
@ -1019,7 +1019,7 @@ yy4:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 1021 "ext/date/lib/parse_date.c"
|
||||
#line 1023 "ext/date/lib/parse_date.c"
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -1330,12 +1330,12 @@ yy12:
|
|||
if (yych <= '9') goto yy1385;
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
#line 1729 "ext/date/lib/parse_date.re"
|
||||
#line 1731 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1337 "ext/date/lib/parse_date.c"
|
||||
#line 1339 "ext/date/lib/parse_date.c"
|
||||
yy14:
|
||||
YYDEBUG(14, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -2392,11 +2392,11 @@ yy49:
|
|||
if (yych <= '9') goto yy55;
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
#line 1718 "ext/date/lib/parse_date.re"
|
||||
#line 1720 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2398 "ext/date/lib/parse_date.c"
|
||||
#line 2400 "ext/date/lib/parse_date.c"
|
||||
yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -2405,12 +2405,12 @@ yy52:
|
|||
YYDEBUG(52, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
#line 1723 "ext/date/lib/parse_date.re"
|
||||
#line 1725 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2412 "ext/date/lib/parse_date.c"
|
||||
#line 2414 "ext/date/lib/parse_date.c"
|
||||
yy54:
|
||||
YYDEBUG(54, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -2797,7 +2797,7 @@ yy72:
|
|||
if (yych == 's') goto yy74;
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
#line 1702 "ext/date/lib/parse_date.re"
|
||||
#line 1704 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
|
@ -2812,7 +2812,7 @@ yy73:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2814 "ext/date/lib/parse_date.c"
|
||||
#line 2816 "ext/date/lib/parse_date.c"
|
||||
yy74:
|
||||
YYDEBUG(74, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -3574,7 +3574,7 @@ yy166:
|
|||
}
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
#line 1565 "ext/date/lib/parse_date.re"
|
||||
#line 1567 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
|
@ -3591,7 +3591,7 @@ yy167:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3593 "ext/date/lib/parse_date.c"
|
||||
#line 3595 "ext/date/lib/parse_date.c"
|
||||
yy168:
|
||||
YYDEBUG(168, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -4111,7 +4111,7 @@ yy193:
|
|||
}
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
#line 1624 "ext/date/lib/parse_date.re"
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
|
@ -4120,7 +4120,7 @@ yy194:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4122 "ext/date/lib/parse_date.c"
|
||||
#line 4124 "ext/date/lib/parse_date.c"
|
||||
yy195:
|
||||
YYDEBUG(195, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
|
@ -4171,7 +4171,7 @@ yy198:
|
|||
}
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
#line 1374 "ext/date/lib/parse_date.re"
|
||||
#line 1376 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
TIMELIB_INIT;
|
||||
|
@ -4183,7 +4183,7 @@ yy199:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4185 "ext/date/lib/parse_date.c"
|
||||
#line 4187 "ext/date/lib/parse_date.c"
|
||||
yy200:
|
||||
YYDEBUG(200, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
|
@ -4452,7 +4452,7 @@ yy222:
|
|||
}
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
#line 1672 "ext/date/lib/parse_date.re"
|
||||
#line 1674 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
|
@ -4481,7 +4481,7 @@ yy223:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4483 "ext/date/lib/parse_date.c"
|
||||
#line 4485 "ext/date/lib/parse_date.c"
|
||||
yy224:
|
||||
YYDEBUG(224, *YYCURSOR);
|
||||
yyaccept = 7;
|
||||
|
@ -5179,7 +5179,7 @@ yy278:
|
|||
YYDEBUG(278, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
#line 1648 "ext/date/lib/parse_date.re"
|
||||
#line 1650 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
|
@ -5202,7 +5202,7 @@ yy278:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 5204 "ext/date/lib/parse_date.c"
|
||||
#line 5206 "ext/date/lib/parse_date.c"
|
||||
yy280:
|
||||
YYDEBUG(280, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -5380,7 +5380,7 @@ yy294:
|
|||
++YYCURSOR;
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
#line 1348 "ext/date/lib/parse_date.re"
|
||||
#line 1350 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
TIMELIB_INIT;
|
||||
|
@ -5392,7 +5392,7 @@ yy295:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5394 "ext/date/lib/parse_date.c"
|
||||
#line 5396 "ext/date/lib/parse_date.c"
|
||||
yy296:
|
||||
YYDEBUG(296, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -6612,7 +6612,7 @@ yy362:
|
|||
if (yych <= '9') goto yy365;
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
#line 1488 "ext/date/lib/parse_date.re"
|
||||
#line 1490 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
TIMELIB_INIT;
|
||||
|
@ -6624,7 +6624,7 @@ yy364:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6626 "ext/date/lib/parse_date.c"
|
||||
#line 6628 "ext/date/lib/parse_date.c"
|
||||
yy365:
|
||||
YYDEBUG(365, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -7262,7 +7262,7 @@ yy392:
|
|||
}
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
#line 1544 "ext/date/lib/parse_date.re"
|
||||
#line 1546 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
|
@ -7282,7 +7282,7 @@ yy393:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 7284 "ext/date/lib/parse_date.c"
|
||||
#line 7286 "ext/date/lib/parse_date.c"
|
||||
yy394:
|
||||
YYDEBUG(394, *YYCURSOR);
|
||||
yyaccept = 5;
|
||||
|
@ -9032,7 +9032,7 @@ yy454:
|
|||
++YYCURSOR;
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
#line 1258 "ext/date/lib/parse_date.re"
|
||||
#line 1260 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
|
@ -9043,7 +9043,7 @@ yy455:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 9045 "ext/date/lib/parse_date.c"
|
||||
#line 9047 "ext/date/lib/parse_date.c"
|
||||
yy456:
|
||||
YYDEBUG(456, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
|
@ -9603,7 +9603,7 @@ yy475:
|
|||
}
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
#line 1387 "ext/date/lib/parse_date.re"
|
||||
#line 1389 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
|
@ -9614,7 +9614,7 @@ yy476:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9616 "ext/date/lib/parse_date.c"
|
||||
#line 9618 "ext/date/lib/parse_date.c"
|
||||
yy477:
|
||||
YYDEBUG(477, *YYCURSOR);
|
||||
yyaccept = 10;
|
||||
|
@ -9755,7 +9755,7 @@ yy488:
|
|||
YYDEBUG(488, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
#line 1114 "ext/date/lib/parse_date.re"
|
||||
#line 1116 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
|
@ -9771,7 +9771,7 @@ yy488:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9773 "ext/date/lib/parse_date.c"
|
||||
#line 9775 "ext/date/lib/parse_date.c"
|
||||
yy490:
|
||||
YYDEBUG(490, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
|
@ -9784,7 +9784,7 @@ yy490:
|
|||
}
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
#line 1151 "ext/date/lib/parse_date.re"
|
||||
#line 1153 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
|
@ -9809,7 +9809,7 @@ yy491:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9811 "ext/date/lib/parse_date.c"
|
||||
#line 9813 "ext/date/lib/parse_date.c"
|
||||
yy492:
|
||||
YYDEBUG(492, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
|
@ -10119,7 +10119,7 @@ yy523:
|
|||
YYDEBUG(523, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
#line 1131 "ext/date/lib/parse_date.re"
|
||||
#line 1133 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
|
@ -10138,7 +10138,7 @@ yy523:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 10140 "ext/date/lib/parse_date.c"
|
||||
#line 10142 "ext/date/lib/parse_date.c"
|
||||
yy525:
|
||||
YYDEBUG(525, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
|
@ -10244,7 +10244,7 @@ yy534:
|
|||
if (yych <= '9') goto yy541;
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
#line 1309 "ext/date/lib/parse_date.re"
|
||||
#line 1311 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datefull");
|
||||
TIMELIB_INIT;
|
||||
|
@ -10257,7 +10257,7 @@ yy535:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 10259 "ext/date/lib/parse_date.c"
|
||||
#line 10261 "ext/date/lib/parse_date.c"
|
||||
yy536:
|
||||
YYDEBUG(536, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -10994,7 +10994,7 @@ yy605:
|
|||
YYDEBUG(606, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
#line 1323 "ext/date/lib/parse_date.re"
|
||||
#line 1325 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
|
@ -11005,7 +11005,7 @@ yy605:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11007 "ext/date/lib/parse_date.c"
|
||||
#line 11009 "ext/date/lib/parse_date.c"
|
||||
yy608:
|
||||
YYDEBUG(608, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
|
@ -11041,7 +11041,7 @@ yy611:
|
|||
if (yych <= '9') goto yy605;
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
#line 1335 "ext/date/lib/parse_date.re"
|
||||
#line 1337 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
TIMELIB_INIT;
|
||||
|
@ -11053,7 +11053,7 @@ yy612:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11055 "ext/date/lib/parse_date.c"
|
||||
#line 11057 "ext/date/lib/parse_date.c"
|
||||
yy613:
|
||||
YYDEBUG(613, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
|
@ -11694,7 +11694,7 @@ yy656:
|
|||
}
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
#line 1296 "ext/date/lib/parse_date.re"
|
||||
#line 1298 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
TIMELIB_INIT;
|
||||
|
@ -11706,7 +11706,7 @@ yy657:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11708 "ext/date/lib/parse_date.c"
|
||||
#line 11710 "ext/date/lib/parse_date.c"
|
||||
yy658:
|
||||
YYDEBUG(658, *YYCURSOR);
|
||||
yyaccept = 13;
|
||||
|
@ -11812,7 +11812,7 @@ yy666:
|
|||
}
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
#line 1243 "ext/date/lib/parse_date.re"
|
||||
#line 1245 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
TIMELIB_INIT;
|
||||
|
@ -11826,7 +11826,7 @@ yy667:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11828 "ext/date/lib/parse_date.c"
|
||||
#line 11830 "ext/date/lib/parse_date.c"
|
||||
yy668:
|
||||
YYDEBUG(668, *YYCURSOR);
|
||||
yyaccept = 14;
|
||||
|
@ -12059,7 +12059,7 @@ yy700:
|
|||
if (yych <= ':') goto yy704;
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
#line 1514 "ext/date/lib/parse_date.re"
|
||||
#line 1516 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
|
@ -12079,7 +12079,7 @@ yy701:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12081 "ext/date/lib/parse_date.c"
|
||||
#line 12083 "ext/date/lib/parse_date.c"
|
||||
yy702:
|
||||
YYDEBUG(702, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -12631,7 +12631,7 @@ yy763:
|
|||
}
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
#line 1270 "ext/date/lib/parse_date.re"
|
||||
#line 1272 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
TIMELIB_INIT;
|
||||
|
@ -12643,7 +12643,7 @@ yy764:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 12645 "ext/date/lib/parse_date.c"
|
||||
#line 12647 "ext/date/lib/parse_date.c"
|
||||
yy765:
|
||||
YYDEBUG(765, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -12682,7 +12682,7 @@ yy771:
|
|||
YYDEBUG(771, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
#line 1501 "ext/date/lib/parse_date.re"
|
||||
#line 1503 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
TIMELIB_INIT;
|
||||
|
@ -12694,7 +12694,7 @@ yy771:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 12696 "ext/date/lib/parse_date.c"
|
||||
#line 12698 "ext/date/lib/parse_date.c"
|
||||
yy773:
|
||||
YYDEBUG(773, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -12832,7 +12832,7 @@ yy783:
|
|||
}
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
#line 1535 "ext/date/lib/parse_date.re"
|
||||
#line 1537 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
|
@ -12840,7 +12840,7 @@ yy784:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12842 "ext/date/lib/parse_date.c"
|
||||
#line 12844 "ext/date/lib/parse_date.c"
|
||||
yy785:
|
||||
YYDEBUG(785, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -12991,7 +12991,7 @@ yy793:
|
|||
}
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
#line 1361 "ext/date/lib/parse_date.re"
|
||||
#line 1363 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
TIMELIB_INIT;
|
||||
|
@ -13003,7 +13003,7 @@ yy794:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 13005 "ext/date/lib/parse_date.c"
|
||||
#line 13007 "ext/date/lib/parse_date.c"
|
||||
yy795:
|
||||
YYDEBUG(795, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -13218,7 +13218,7 @@ yy814:
|
|||
if (yych <= '7') goto yy817;
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
#line 1469 "ext/date/lib/parse_date.re"
|
||||
#line 1471 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
|
@ -13236,7 +13236,7 @@ yy815:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13238 "ext/date/lib/parse_date.c"
|
||||
#line 13240 "ext/date/lib/parse_date.c"
|
||||
yy816:
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -13246,7 +13246,7 @@ yy817:
|
|||
YYDEBUG(817, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
#line 1450 "ext/date/lib/parse_date.re"
|
||||
#line 1452 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
|
@ -13264,7 +13264,7 @@ yy817:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13266 "ext/date/lib/parse_date.c"
|
||||
#line 13268 "ext/date/lib/parse_date.c"
|
||||
yy819:
|
||||
YYDEBUG(819, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -13328,7 +13328,7 @@ yy821:
|
|||
}
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
#line 1437 "ext/date/lib/parse_date.re"
|
||||
#line 1439 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
TIMELIB_INIT;
|
||||
|
@ -13340,7 +13340,7 @@ yy822:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 13342 "ext/date/lib/parse_date.c"
|
||||
#line 13344 "ext/date/lib/parse_date.c"
|
||||
yy823:
|
||||
YYDEBUG(823, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -13443,7 +13443,7 @@ yy842:
|
|||
++YYCURSOR;
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
#line 1411 "ext/date/lib/parse_date.re"
|
||||
#line 1413 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
|
@ -13468,7 +13468,7 @@ yy843:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 13470 "ext/date/lib/parse_date.c"
|
||||
#line 13472 "ext/date/lib/parse_date.c"
|
||||
yy844:
|
||||
YYDEBUG(844, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -13730,7 +13730,7 @@ yy848:
|
|||
}
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
#line 1399 "ext/date/lib/parse_date.re"
|
||||
#line 1401 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
|
@ -13741,7 +13741,7 @@ yy849:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 13743 "ext/date/lib/parse_date.c"
|
||||
#line 13745 "ext/date/lib/parse_date.c"
|
||||
yy850:
|
||||
YYDEBUG(850, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -14661,7 +14661,7 @@ yy973:
|
|||
if (yych <= '9') goto yy996;
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
#line 1283 "ext/date/lib/parse_date.re"
|
||||
#line 1285 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
TIMELIB_INIT;
|
||||
|
@ -14673,7 +14673,7 @@ yy974:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 14675 "ext/date/lib/parse_date.c"
|
||||
#line 14677 "ext/date/lib/parse_date.c"
|
||||
yy975:
|
||||
YYDEBUG(975, *YYCURSOR);
|
||||
yyaccept = 22;
|
||||
|
@ -15682,7 +15682,7 @@ yy1066:
|
|||
}
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
#line 1177 "ext/date/lib/parse_date.re"
|
||||
#line 1179 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
|
@ -15704,7 +15704,7 @@ yy1068:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 15706 "ext/date/lib/parse_date.c"
|
||||
#line 15708 "ext/date/lib/parse_date.c"
|
||||
yy1069:
|
||||
YYDEBUG(1069, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -15796,7 +15796,7 @@ yy1075:
|
|||
}
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
#line 1223 "ext/date/lib/parse_date.re"
|
||||
#line 1225 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
|
@ -15815,7 +15815,7 @@ yy1076:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 15817 "ext/date/lib/parse_date.c"
|
||||
#line 15819 "ext/date/lib/parse_date.c"
|
||||
yy1077:
|
||||
YYDEBUG(1077, *YYCURSOR);
|
||||
yyaccept = 25;
|
||||
|
@ -16713,7 +16713,7 @@ yy1117:
|
|||
}
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
#line 1607 "ext/date/lib/parse_date.re"
|
||||
#line 1609 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
|
@ -16729,7 +16729,7 @@ yy1118:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16731 "ext/date/lib/parse_date.c"
|
||||
#line 16733 "ext/date/lib/parse_date.c"
|
||||
yy1119:
|
||||
YYDEBUG(1119, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
|
@ -16780,7 +16780,7 @@ yy1126:
|
|||
YYDEBUG(1126, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
#line 1092 "ext/date/lib/parse_date.re"
|
||||
#line 1094 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
|
@ -16801,7 +16801,7 @@ yy1126:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 16803 "ext/date/lib/parse_date.c"
|
||||
#line 16805 "ext/date/lib/parse_date.c"
|
||||
yy1128:
|
||||
YYDEBUG(1128, *YYCURSOR);
|
||||
yyaccept = 26;
|
||||
|
@ -16909,7 +16909,7 @@ yy1141:
|
|||
}
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
#line 1583 "ext/date/lib/parse_date.re"
|
||||
#line 1585 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
|
@ -16932,7 +16932,7 @@ yy1142:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16934 "ext/date/lib/parse_date.c"
|
||||
#line 16936 "ext/date/lib/parse_date.c"
|
||||
yy1143:
|
||||
YYDEBUG(1143, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -19609,7 +19609,7 @@ yy1294:
|
|||
goto yy1298;
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
#line 1069 "ext/date/lib/parse_date.re"
|
||||
#line 1071 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
|
@ -19631,7 +19631,7 @@ yy1295:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19633 "ext/date/lib/parse_date.c"
|
||||
#line 19635 "ext/date/lib/parse_date.c"
|
||||
yy1296:
|
||||
YYDEBUG(1296, *YYCURSOR);
|
||||
yyaccept = 28;
|
||||
|
@ -21322,7 +21322,7 @@ yy1385:
|
|||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
YYDEBUG(1387, *YYCURSOR);
|
||||
#line 1027 "ext/date/lib/parse_date.re"
|
||||
#line 1029 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
|
@ -21346,7 +21346,7 @@ yy1387:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21348 "ext/date/lib/parse_date.c"
|
||||
#line 21350 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -21782,7 +21782,7 @@ yy1416:
|
|||
++YYCURSOR;
|
||||
yy1417:
|
||||
YYDEBUG(1417, *YYCURSOR);
|
||||
#line 1015 "ext/date/lib/parse_date.re"
|
||||
#line 1017 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
|
@ -21793,7 +21793,7 @@ yy1417:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21795 "ext/date/lib/parse_date.c"
|
||||
#line 21797 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -21828,7 +21828,7 @@ yy1419:
|
|||
}
|
||||
yy1420:
|
||||
YYDEBUG(1420, *YYCURSOR);
|
||||
#line 1005 "ext/date/lib/parse_date.re"
|
||||
#line 1007 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
|
@ -21837,7 +21837,7 @@ yy1420:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21839 "ext/date/lib/parse_date.c"
|
||||
#line 21841 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -23849,7 +23849,7 @@ yy1499:
|
|||
}
|
||||
yy1500:
|
||||
YYDEBUG(1500, *YYCURSOR);
|
||||
#line 984 "ext/date/lib/parse_date.re"
|
||||
#line 986 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
|
@ -23857,7 +23857,7 @@ yy1500:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23859 "ext/date/lib/parse_date.c"
|
||||
#line 23861 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
|
@ -23996,7 +23996,7 @@ yy1507:
|
|||
}
|
||||
yy1508:
|
||||
YYDEBUG(1508, *YYCURSOR);
|
||||
#line 993 "ext/date/lib/parse_date.re"
|
||||
#line 995 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
|
@ -24007,7 +24007,7 @@ yy1508:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24009 "ext/date/lib/parse_date.c"
|
||||
#line 24011 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
|
@ -24540,7 +24540,7 @@ yy1530:
|
|||
++YYCURSOR;
|
||||
yy1531:
|
||||
YYDEBUG(1531, *YYCURSOR);
|
||||
#line 972 "ext/date/lib/parse_date.re"
|
||||
#line 974 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
|
@ -24551,7 +24551,7 @@ yy1531:
|
|||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24553 "ext/date/lib/parse_date.c"
|
||||
#line 24555 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
|
@ -24724,7 +24724,7 @@ yy1537:
|
|||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1733 "ext/date/lib/parse_date.re"
|
||||
#line 1735 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
|
@ -24791,6 +24791,10 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
|||
#endif
|
||||
} while(t != EOI);
|
||||
|
||||
/* do funky checking whether the parsed time was valid time */
|
||||
if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
|
||||
add_warning(&in, "The parsed time was invalid");
|
||||
}
|
||||
/* do funky checking whether the parsed date was valid date */
|
||||
if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
|
||||
add_warning(&in, "The parsed date was invalid");
|
||||
|
|
|
@ -1798,6 +1798,10 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
|||
#endif
|
||||
} while(t != EOI);
|
||||
|
||||
/* do funky checking whether the parsed time was valid time */
|
||||
if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
|
||||
add_warning(&in, "The parsed time was invalid");
|
||||
}
|
||||
/* do funky checking whether the parsed date was valid date */
|
||||
if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
|
||||
add_warning(&in, "The parsed date was invalid");
|
||||
|
|
37
ext/date/tests/bug52430.phpt
Normal file
37
ext/date/tests/bug52430.phpt
Normal file
|
@ -0,0 +1,37 @@
|
|||
--TEST--
|
||||
Bug #52430 (date_parse parse 24:xx:xx as valid time)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(date_parse('2010-1-1 24:59:59'));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(12) {
|
||||
["year"]=>
|
||||
int(2010)
|
||||
["month"]=>
|
||||
int(1)
|
||||
["day"]=>
|
||||
int(1)
|
||||
["hour"]=>
|
||||
int(24)
|
||||
["minute"]=>
|
||||
int(59)
|
||||
["second"]=>
|
||||
int(59)
|
||||
["fraction"]=>
|
||||
float(0)
|
||||
["warning_count"]=>
|
||||
int(1)
|
||||
["warnings"]=>
|
||||
array(1) {
|
||||
[18]=>
|
||||
string(27) "The parsed time was invalid"
|
||||
}
|
||||
["error_count"]=>
|
||||
int(0)
|
||||
["errors"]=>
|
||||
array(0) {
|
||||
}
|
||||
["is_localtime"]=>
|
||||
bool(false)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue