From: Derick Rethans Date: Mon, 6 Mar 2006 21:43:35 +0000 (+0000) Subject: - Fixed bug #36638 (strtotime unconditional false return on now <= 0) X-Git-Tag: RELEASE_1_3~518 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb7246d36fd4e82539f1b7e6d5c0b7115622395d;p=php - Fixed bug #36638 (strtotime unconditional false return on now <= 0) --- diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 220516375e..f4f7e6a6db 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.12 on Mon Feb 27 20:38:29 2006 */ +/* Generated by re2c 0.9.12 on Mon Mar 6 22:41:59 2006 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -1139,7 +1139,7 @@ yy11: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if(yych == '-') goto yy1185; - if(yych <= '0') goto yy12; + if(yych <= '/') goto yy12; if(yych <= '9') goto yy1186; goto yy12; yy12: @@ -16619,7 +16619,7 @@ yy1184: yy1185: YYDEBUG(1185, *YYCURSOR); yych = *++YYCURSOR; - if(yych <= '0') goto yy53; + if(yych <= '/') goto yy53; if(yych >= ':') goto yy53; goto yy1186; yy1186: diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index c763204b79..7d65c76bb0 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -825,7 +825,7 @@ exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" sec clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection; /* Timestamp format: @1126396800 */ -timestamp = "@" "-"? [1-9] [0-9]*; +timestamp = "@" "-"? [0-9]+; /* To fix some ambiguities */ dateshortwithtimeshort = datenoyear timeshort24; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 337fe69857..14036e4fcb 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -949,7 +949,7 @@ PHP_FUNCTION(strtotime) now = timelib_time_ctor(); initial_ts = emalloc(25); - snprintf(initial_ts, 24, "@%lu", preset_ts); + snprintf(initial_ts, 24, "@%ld", preset_ts); t = timelib_strtotime(initial_ts, strlen(initial_ts), &error1, DATE_TIMEZONEDB); /* we ignore the error here, as this should never fail */ timelib_update_ts(t, tzi); now->tz_info = tzi;