--- embedaddon/php/ext/date/lib/parse_date.c 2013/10/14 08:02:09 1.1.1.4 +++ embedaddon/php/ext/date/lib/parse_date.c 2014/06/15 20:03:41 1.1.1.5 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sun Aug 25 14:46:08 2013 */ +/* Generated by re2c 0.13.5 on Tue May 13 16:52:44 2014 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: parse_date.c,v 1.1.1.4 2013/10/14 08:02:09 misho Exp $ */ +/* $Id: parse_date.c,v 1.1.1.5 2014/06/15 20:03:41 misho Exp $ */ #include "timelib.h" @@ -402,9 +402,12 @@ static timelib_sll timelib_meridian_with_check(char ** { timelib_sll retval = 0; - while (!strchr("AaPp", **ptr)) { + while (**ptr && !strchr("AaPp", **ptr)) { ++*ptr; } + if(!**ptr) { + return TIMELIB_UNSET; + } if (**ptr == 'a' || **ptr == 'A') { if (h == 12) { retval = -12; @@ -751,7 +754,7 @@ const static timelib_tz_lookup_table* zone_search(cons /* Still didn't find anything, let's find the zone solely based on * offset/isdst then */ for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { + if ((fmp->gmtoffset * 60) == gmtoffset && fmp->type == isdst) { return fmp; } } @@ -24938,7 +24941,7 @@ timelib_time *timelib_parse_from_format(char *format, TIMELIB_CHECK_NUMBER; sec = timelib_get_nr_ex((char **) &ptr, 2, &length); if (sec == TIMELIB_UNSET || length != 2) { - add_pbf_error(s, "A two second minute could not be found", string, begin); + add_pbf_error(s, "A two digit second could not be found", string, begin); } else { s->time->s = sec; } @@ -25026,6 +25029,10 @@ timelib_time *timelib_parse_from_format(char *format, break; case '\\': /* escaped char */ + if(!fptr[1]) { + add_pbf_error(s, "Escaped character expected", string, begin); + break; + } fptr++; if (*ptr == *fptr) { ++ptr;