Fixed bug#51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error)

This commit is contained in:
Hannes Magnusson 2011-06-05 13:30:01 +00:00
parent eed6bdb5c7
commit 6f56bf1cfc
3 changed files with 138 additions and 101 deletions

View File

@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Mon Mar 28 05:04:54 2011 */
/* Generated by re2c 0.13.5 on Sun Jun 5 15:20:19 2011 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@ -721,6 +721,25 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
return first_found_elem;
}
for (tp = timelib_timezone_lookup; tp->name; tp++) {
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
if (!first_found) {
first_found = 1;
first_found_elem = tp;
if (gmtoffset == -1) {
return tp;
}
}
if (tp->gmtoffset == gmtoffset) {
return tp;
}
}
}
if (first_found) {
return first_found_elem;
}
/* Still didn't find anything, let's find the zone solely based on
* offset/isdst then */
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
@ -844,11 +863,11 @@ static int scan(Scanner *s)
std:
s->tok = cursor;
s->len = 0;
#line 970 "ext/date/lib/parse_date.re"
#line 989 "ext/date/lib/parse_date.re"
#line 852 "ext/date/lib/parse_date.c"
#line 871 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@ -968,7 +987,7 @@ std:
}
yy2:
YYDEBUG(2, *YYCURSOR);
#line 1055 "ext/date/lib/parse_date.re"
#line 1074 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@ -984,7 +1003,7 @@ yy2:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 988 "ext/date/lib/parse_date.c"
#line 1007 "ext/date/lib/parse_date.c"
yy3:
YYDEBUG(3, *YYCURSOR);
++YYCURSOR;
@ -1007,7 +1026,7 @@ yy3:
}
yy4:
YYDEBUG(4, *YYCURSOR);
#line 1637 "ext/date/lib/parse_date.re"
#line 1656 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@ -1020,7 +1039,7 @@ yy4:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 1024 "ext/date/lib/parse_date.c"
#line 1043 "ext/date/lib/parse_date.c"
yy5:
YYDEBUG(5, *YYCURSOR);
yych = *++YYCURSOR;
@ -1331,12 +1350,12 @@ yy12:
if (yych <= '9') goto yy1385;
yy13:
YYDEBUG(13, *YYCURSOR);
#line 1732 "ext/date/lib/parse_date.re"
#line 1751 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 1340 "ext/date/lib/parse_date.c"
#line 1359 "ext/date/lib/parse_date.c"
yy14:
YYDEBUG(14, *YYCURSOR);
yych = *++YYCURSOR;
@ -2393,11 +2412,11 @@ yy49:
if (yych <= '9') goto yy55;
yy50:
YYDEBUG(50, *YYCURSOR);
#line 1721 "ext/date/lib/parse_date.re"
#line 1740 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 2401 "ext/date/lib/parse_date.c"
#line 2420 "ext/date/lib/parse_date.c"
yy51:
YYDEBUG(51, *YYCURSOR);
yych = *++YYCURSOR;
@ -2406,12 +2425,12 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
#line 1726 "ext/date/lib/parse_date.re"
#line 1745 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 2415 "ext/date/lib/parse_date.c"
#line 2434 "ext/date/lib/parse_date.c"
yy54:
YYDEBUG(54, *YYCURSOR);
yych = *++YYCURSOR;
@ -2798,7 +2817,7 @@ yy72:
if (yych == 's') goto yy74;
yy73:
YYDEBUG(73, *YYCURSOR);
#line 1705 "ext/date/lib/parse_date.re"
#line 1724 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@ -2813,7 +2832,7 @@ yy73:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2817 "ext/date/lib/parse_date.c"
#line 2836 "ext/date/lib/parse_date.c"
yy74:
YYDEBUG(74, *YYCURSOR);
yych = *++YYCURSOR;
@ -3575,7 +3594,7 @@ yy166:
}
yy167:
YYDEBUG(167, *YYCURSOR);
#line 1568 "ext/date/lib/parse_date.re"
#line 1587 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@ -3592,7 +3611,7 @@ yy167:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3596 "ext/date/lib/parse_date.c"
#line 3615 "ext/date/lib/parse_date.c"
yy168:
YYDEBUG(168, *YYCURSOR);
yych = *++YYCURSOR;
@ -4112,7 +4131,7 @@ yy193:
}
yy194:
YYDEBUG(194, *YYCURSOR);
#line 1627 "ext/date/lib/parse_date.re"
#line 1646 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@ -4121,7 +4140,7 @@ yy194:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4125 "ext/date/lib/parse_date.c"
#line 4144 "ext/date/lib/parse_date.c"
yy195:
YYDEBUG(195, *YYCURSOR);
++YYCURSOR;
@ -4172,7 +4191,7 @@ yy198:
}
yy199:
YYDEBUG(199, *YYCURSOR);
#line 1377 "ext/date/lib/parse_date.re"
#line 1396 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datetextual | datenoyear");
TIMELIB_INIT;
@ -4184,7 +4203,7 @@ yy199:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4188 "ext/date/lib/parse_date.c"
#line 4207 "ext/date/lib/parse_date.c"
yy200:
YYDEBUG(200, *YYCURSOR);
yyaccept = 6;
@ -4453,7 +4472,7 @@ yy222:
}
yy223:
YYDEBUG(223, *YYCURSOR);
#line 1675 "ext/date/lib/parse_date.re"
#line 1694 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@ -4482,7 +4501,7 @@ yy223:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4486 "ext/date/lib/parse_date.c"
#line 4505 "ext/date/lib/parse_date.c"
yy224:
YYDEBUG(224, *YYCURSOR);
yyaccept = 7;
@ -5180,7 +5199,7 @@ yy278:
YYDEBUG(278, *YYCURSOR);
++YYCURSOR;
YYDEBUG(279, *YYCURSOR);
#line 1651 "ext/date/lib/parse_date.re"
#line 1670 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@ -5203,7 +5222,7 @@ yy278:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 5207 "ext/date/lib/parse_date.c"
#line 5226 "ext/date/lib/parse_date.c"
yy280:
YYDEBUG(280, *YYCURSOR);
yych = *++YYCURSOR;
@ -5381,7 +5400,7 @@ yy294:
++YYCURSOR;
yy295:
YYDEBUG(295, *YYCURSOR);
#line 1351 "ext/date/lib/parse_date.re"
#line 1370 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoday");
TIMELIB_INIT;
@ -5393,7 +5412,7 @@ yy295:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5397 "ext/date/lib/parse_date.c"
#line 5416 "ext/date/lib/parse_date.c"
yy296:
YYDEBUG(296, *YYCURSOR);
yych = *++YYCURSOR;
@ -6613,7 +6632,7 @@ yy362:
if (yych <= '9') goto yy365;
yy364:
YYDEBUG(364, *YYCURSOR);
#line 1491 "ext/date/lib/parse_date.re"
#line 1510 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextshort");
TIMELIB_INIT;
@ -6625,7 +6644,7 @@ yy364:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6629 "ext/date/lib/parse_date.c"
#line 6648 "ext/date/lib/parse_date.c"
yy365:
YYDEBUG(365, *YYCURSOR);
yych = *++YYCURSOR;
@ -7263,7 +7282,7 @@ yy392:
}
yy393:
YYDEBUG(393, *YYCURSOR);
#line 1547 "ext/date/lib/parse_date.re"
#line 1566 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@ -7283,7 +7302,7 @@ yy393:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 7287 "ext/date/lib/parse_date.c"
#line 7306 "ext/date/lib/parse_date.c"
yy394:
YYDEBUG(394, *YYCURSOR);
yyaccept = 5;
@ -9033,7 +9052,7 @@ yy454:
++YYCURSOR;
yy455:
YYDEBUG(455, *YYCURSOR);
#line 1261 "ext/date/lib/parse_date.re"
#line 1280 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@ -9044,7 +9063,7 @@ yy455:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 9048 "ext/date/lib/parse_date.c"
#line 9067 "ext/date/lib/parse_date.c"
yy456:
YYDEBUG(456, *YYCURSOR);
yyaccept = 0;
@ -9604,7 +9623,7 @@ yy475:
}
yy476:
YYDEBUG(476, *YYCURSOR);
#line 1390 "ext/date/lib/parse_date.re"
#line 1409 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@ -9615,7 +9634,7 @@ yy476:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9619 "ext/date/lib/parse_date.c"
#line 9638 "ext/date/lib/parse_date.c"
yy477:
YYDEBUG(477, *YYCURSOR);
yyaccept = 10;
@ -9756,7 +9775,7 @@ yy488:
YYDEBUG(488, *YYCURSOR);
++YYCURSOR;
YYDEBUG(489, *YYCURSOR);
#line 1117 "ext/date/lib/parse_date.re"
#line 1136 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@ -9772,7 +9791,7 @@ yy488:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9776 "ext/date/lib/parse_date.c"
#line 9795 "ext/date/lib/parse_date.c"
yy490:
YYDEBUG(490, *YYCURSOR);
yyaccept = 11;
@ -9785,7 +9804,7 @@ yy490:
}
yy491:
YYDEBUG(491, *YYCURSOR);
#line 1154 "ext/date/lib/parse_date.re"
#line 1173 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@ -9810,7 +9829,7 @@ yy491:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9814 "ext/date/lib/parse_date.c"
#line 9833 "ext/date/lib/parse_date.c"
yy492:
YYDEBUG(492, *YYCURSOR);
yyaccept = 11;
@ -10120,7 +10139,7 @@ yy523:
YYDEBUG(523, *YYCURSOR);
++YYCURSOR;
YYDEBUG(524, *YYCURSOR);
#line 1134 "ext/date/lib/parse_date.re"
#line 1153 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@ -10139,7 +10158,7 @@ yy523:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 10143 "ext/date/lib/parse_date.c"
#line 10162 "ext/date/lib/parse_date.c"
yy525:
YYDEBUG(525, *YYCURSOR);
yyaccept = 11;
@ -10245,7 +10264,7 @@ yy534:
if (yych <= '9') goto yy541;
yy535:
YYDEBUG(535, *YYCURSOR);
#line 1312 "ext/date/lib/parse_date.re"
#line 1331 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datefull");
TIMELIB_INIT;
@ -10258,7 +10277,7 @@ yy535:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 10262 "ext/date/lib/parse_date.c"
#line 10281 "ext/date/lib/parse_date.c"
yy536:
YYDEBUG(536, *YYCURSOR);
yych = *++YYCURSOR;
@ -10995,7 +11014,7 @@ yy605:
YYDEBUG(606, *YYCURSOR);
++YYCURSOR;
YYDEBUG(607, *YYCURSOR);
#line 1326 "ext/date/lib/parse_date.re"
#line 1345 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@ -11006,7 +11025,7 @@ yy605:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11010 "ext/date/lib/parse_date.c"
#line 11029 "ext/date/lib/parse_date.c"
yy608:
YYDEBUG(608, *YYCURSOR);
yyaccept = 11;
@ -11042,7 +11061,7 @@ yy611:
if (yych <= '9') goto yy605;
yy612:
YYDEBUG(612, *YYCURSOR);
#line 1338 "ext/date/lib/parse_date.re"
#line 1357 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YY");
TIMELIB_INIT;
@ -11054,7 +11073,7 @@ yy612:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11058 "ext/date/lib/parse_date.c"
#line 11077 "ext/date/lib/parse_date.c"
yy613:
YYDEBUG(613, *YYCURSOR);
yyaccept = 11;
@ -11695,7 +11714,7 @@ yy656:
}
yy657:
YYDEBUG(657, *YYCURSOR);
#line 1299 "ext/date/lib/parse_date.re"
#line 1318 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnudateshort");
TIMELIB_INIT;
@ -11707,7 +11726,7 @@ yy657:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11711 "ext/date/lib/parse_date.c"
#line 11730 "ext/date/lib/parse_date.c"
yy658:
YYDEBUG(658, *YYCURSOR);
yyaccept = 13;
@ -11813,7 +11832,7 @@ yy666:
}
yy667:
YYDEBUG(667, *YYCURSOR);
#line 1246 "ext/date/lib/parse_date.re"
#line 1265 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("americanshort | american");
TIMELIB_INIT;
@ -11827,7 +11846,7 @@ yy667:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11831 "ext/date/lib/parse_date.c"
#line 11850 "ext/date/lib/parse_date.c"
yy668:
YYDEBUG(668, *YYCURSOR);
yyaccept = 14;
@ -12060,7 +12079,7 @@ yy700:
if (yych <= ':') goto yy704;
yy701:
YYDEBUG(701, *YYCURSOR);
#line 1517 "ext/date/lib/parse_date.re"
#line 1536 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@ -12080,7 +12099,7 @@ yy701:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12084 "ext/date/lib/parse_date.c"
#line 12103 "ext/date/lib/parse_date.c"
yy702:
YYDEBUG(702, *YYCURSOR);
yych = *++YYCURSOR;
@ -12632,7 +12651,7 @@ yy763:
}
yy764:
YYDEBUG(764, *YYCURSOR);
#line 1273 "ext/date/lib/parse_date.re"
#line 1292 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date2");
TIMELIB_INIT;
@ -12644,7 +12663,7 @@ yy764:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 12648 "ext/date/lib/parse_date.c"
#line 12667 "ext/date/lib/parse_date.c"
yy765:
YYDEBUG(765, *YYCURSOR);
yych = *++YYCURSOR;
@ -12683,7 +12702,7 @@ yy771:
YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
YYDEBUG(772, *YYCURSOR);
#line 1504 "ext/date/lib/parse_date.re"
#line 1523 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextreverse");
TIMELIB_INIT;
@ -12695,7 +12714,7 @@ yy771:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 12699 "ext/date/lib/parse_date.c"
#line 12718 "ext/date/lib/parse_date.c"
yy773:
YYDEBUG(773, *YYCURSOR);
yych = *++YYCURSOR;
@ -12833,7 +12852,7 @@ yy783:
}
yy784:
YYDEBUG(784, *YYCURSOR);
#line 1538 "ext/date/lib/parse_date.re"
#line 1557 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@ -12841,7 +12860,7 @@ yy784:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12845 "ext/date/lib/parse_date.c"
#line 12864 "ext/date/lib/parse_date.c"
yy785:
YYDEBUG(785, *YYCURSOR);
yych = *++YYCURSOR;
@ -12992,7 +13011,7 @@ yy793:
}
yy794:
YYDEBUG(794, *YYCURSOR);
#line 1364 "ext/date/lib/parse_date.re"
#line 1383 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenodayrev");
TIMELIB_INIT;
@ -13004,7 +13023,7 @@ yy794:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 13008 "ext/date/lib/parse_date.c"
#line 13027 "ext/date/lib/parse_date.c"
yy795:
YYDEBUG(795, *YYCURSOR);
yych = *++YYCURSOR;
@ -13219,7 +13238,7 @@ yy814:
if (yych <= '7') goto yy817;
yy815:
YYDEBUG(815, *YYCURSOR);
#line 1472 "ext/date/lib/parse_date.re"
#line 1491 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@ -13237,7 +13256,7 @@ yy815:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13241 "ext/date/lib/parse_date.c"
#line 13260 "ext/date/lib/parse_date.c"
yy816:
YYDEBUG(816, *YYCURSOR);
yych = *++YYCURSOR;
@ -13247,7 +13266,7 @@ yy817:
YYDEBUG(817, *YYCURSOR);
++YYCURSOR;
YYDEBUG(818, *YYCURSOR);
#line 1453 "ext/date/lib/parse_date.re"
#line 1472 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@ -13265,7 +13284,7 @@ yy817:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13269 "ext/date/lib/parse_date.c"
#line 13288 "ext/date/lib/parse_date.c"
yy819:
YYDEBUG(819, *YYCURSOR);
yych = *++YYCURSOR;
@ -13329,7 +13348,7 @@ yy821:
}
yy822:
YYDEBUG(822, *YYCURSOR);
#line 1440 "ext/date/lib/parse_date.re"
#line 1459 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgydotd");
TIMELIB_INIT;
@ -13341,7 +13360,7 @@ yy822:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 13345 "ext/date/lib/parse_date.c"
#line 13364 "ext/date/lib/parse_date.c"
yy823:
YYDEBUG(823, *YYCURSOR);
yych = *++YYCURSOR;
@ -13444,7 +13463,7 @@ yy842:
++YYCURSOR;
yy843:
YYDEBUG(843, *YYCURSOR);
#line 1414 "ext/date/lib/parse_date.re"
#line 1433 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@ -13469,7 +13488,7 @@ yy843:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 13473 "ext/date/lib/parse_date.c"
#line 13492 "ext/date/lib/parse_date.c"
yy844:
YYDEBUG(844, *YYCURSOR);
yych = *++YYCURSOR;
@ -13731,7 +13750,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
#line 1402 "ext/date/lib/parse_date.re"
#line 1421 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@ -13742,7 +13761,7 @@ yy849:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 13746 "ext/date/lib/parse_date.c"
#line 13765 "ext/date/lib/parse_date.c"
yy850:
YYDEBUG(850, *YYCURSOR);
yych = *++YYCURSOR;
@ -14662,7 +14681,7 @@ yy973:
if (yych <= '9') goto yy996;
yy974:
YYDEBUG(974, *YYCURSOR);
#line 1286 "ext/date/lib/parse_date.re"
#line 1305 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnudateshorter");
TIMELIB_INIT;
@ -14674,7 +14693,7 @@ yy974:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 14678 "ext/date/lib/parse_date.c"
#line 14697 "ext/date/lib/parse_date.c"
yy975:
YYDEBUG(975, *YYCURSOR);
yyaccept = 22;
@ -15683,7 +15702,7 @@ yy1066:
}
yy1068:
YYDEBUG(1068, *YYCURSOR);
#line 1180 "ext/date/lib/parse_date.re"
#line 1199 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@ -15705,7 +15724,7 @@ yy1068:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 15709 "ext/date/lib/parse_date.c"
#line 15728 "ext/date/lib/parse_date.c"
yy1069:
YYDEBUG(1069, *YYCURSOR);
yych = *++YYCURSOR;
@ -15797,7 +15816,7 @@ yy1075:
}
yy1076:
YYDEBUG(1076, *YYCURSOR);
#line 1226 "ext/date/lib/parse_date.re"
#line 1245 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@ -15816,7 +15835,7 @@ yy1076:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 15820 "ext/date/lib/parse_date.c"
#line 15839 "ext/date/lib/parse_date.c"
yy1077:
YYDEBUG(1077, *YYCURSOR);
yyaccept = 25;
@ -16714,7 +16733,7 @@ yy1117:
}
yy1118:
YYDEBUG(1118, *YYCURSOR);
#line 1610 "ext/date/lib/parse_date.re"
#line 1629 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@ -16730,7 +16749,7 @@ yy1118:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16734 "ext/date/lib/parse_date.c"
#line 16753 "ext/date/lib/parse_date.c"
yy1119:
YYDEBUG(1119, *YYCURSOR);
++YYCURSOR;
@ -16781,7 +16800,7 @@ yy1126:
YYDEBUG(1126, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1127, *YYCURSOR);
#line 1095 "ext/date/lib/parse_date.re"
#line 1114 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@ -16802,7 +16821,7 @@ yy1126:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 16806 "ext/date/lib/parse_date.c"
#line 16825 "ext/date/lib/parse_date.c"
yy1128:
YYDEBUG(1128, *YYCURSOR);
yyaccept = 26;
@ -16910,7 +16929,7 @@ yy1141:
}
yy1142:
YYDEBUG(1142, *YYCURSOR);
#line 1586 "ext/date/lib/parse_date.re"
#line 1605 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@ -16933,7 +16952,7 @@ yy1142:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16937 "ext/date/lib/parse_date.c"
#line 16956 "ext/date/lib/parse_date.c"
yy1143:
YYDEBUG(1143, *YYCURSOR);
yych = *++YYCURSOR;
@ -19610,7 +19629,7 @@ yy1294:
goto yy1298;
yy1295:
YYDEBUG(1295, *YYCURSOR);
#line 1072 "ext/date/lib/parse_date.re"
#line 1091 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@ -19632,7 +19651,7 @@ yy1295:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19636 "ext/date/lib/parse_date.c"
#line 19655 "ext/date/lib/parse_date.c"
yy1296:
YYDEBUG(1296, *YYCURSOR);
yyaccept = 28;
@ -21323,7 +21342,7 @@ yy1385:
if (yych <= '9') goto yy1385;
yy1387:
YYDEBUG(1387, *YYCURSOR);
#line 1030 "ext/date/lib/parse_date.re"
#line 1049 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@ -21347,7 +21366,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21351 "ext/date/lib/parse_date.c"
#line 21370 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@ -21783,7 +21802,7 @@ yy1416:
++YYCURSOR;
yy1417:
YYDEBUG(1417, *YYCURSOR);
#line 1018 "ext/date/lib/parse_date.re"
#line 1037 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@ -21794,7 +21813,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21798 "ext/date/lib/parse_date.c"
#line 21817 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@ -21829,7 +21848,7 @@ yy1419:
}
yy1420:
YYDEBUG(1420, *YYCURSOR);
#line 1008 "ext/date/lib/parse_date.re"
#line 1027 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@ -21838,7 +21857,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21842 "ext/date/lib/parse_date.c"
#line 21861 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@ -23850,7 +23869,7 @@ yy1499:
}
yy1500:
YYDEBUG(1500, *YYCURSOR);
#line 987 "ext/date/lib/parse_date.re"
#line 1006 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@ -23858,7 +23877,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23862 "ext/date/lib/parse_date.c"
#line 23881 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@ -23997,7 +24016,7 @@ yy1507:
}
yy1508:
YYDEBUG(1508, *YYCURSOR);
#line 996 "ext/date/lib/parse_date.re"
#line 1015 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@ -24008,7 +24027,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24012 "ext/date/lib/parse_date.c"
#line 24031 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@ -24541,7 +24560,7 @@ yy1530:
++YYCURSOR;
yy1531:
YYDEBUG(1531, *YYCURSOR);
#line 975 "ext/date/lib/parse_date.re"
#line 994 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@ -24552,7 +24571,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24556 "ext/date/lib/parse_date.c"
#line 24575 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@ -24725,7 +24744,7 @@ yy1537:
goto yy1531;
}
}
#line 1736 "ext/date/lib/parse_date.re"
#line 1755 "ext/date/lib/parse_date.re"
}

View File

@ -719,6 +719,25 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
return first_found_elem;
}
for (tp = timelib_timezone_lookup; tp->name; tp++) {
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
if (!first_found) {
first_found = 1;
first_found_elem = tp;
if (gmtoffset == -1) {
return tp;
}
}
if (tp->gmtoffset == gmtoffset) {
return tp;
}
}
}
if (first_found) {
return first_found_elem;
}
/* Still didn't find anything, let's find the zone solely based on
* offset/isdst then */
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {

View File

@ -1,7 +1,5 @@
--TEST--
Bug #51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error)
--XFAIL--
Bug #51819 isn't fixed yet
--FILE--
<?php
date_default_timezone_set('UTC');
@ -26,6 +24,7 @@ foreach ($aTz as $sTz) {
$oDateTime = new DateTime($sDate);
} catch (Exception $oException) {
var_dump($oException->getMessage());
print_r(DateTime::getLastErrors());
}
}