- Fixed bug #52430 (date_parse parse 24:xx:xx as valid time). (Derick)

This commit is contained in:
Derick Rethans 2010-08-30 16:40:29 +00:00
parent fcc22c6af3
commit 1fc5e47fb6
3 changed files with 143 additions and 98 deletions

View file

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

View file

@ -1798,6 +1798,10 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
#endif #endif
} while(t != EOI); } 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 */ /* 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)) { 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"); add_warning(&in, "The parsed date was invalid");

View 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)
}