From: Adam Harvey Date: Fri, 26 Mar 2010 10:12:43 +0000 (+0000) Subject: Backported the fix for bug #51393 (DateTime::createFromFormat() fails if format X-Git-Tag: php-5.2.14RC1~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82d44802be26d6fb041322c1fe4218cd6120e926;p=php Backported the fix for bug #51393 (DateTime::createFromFormat() fails if format string contains timezone) to PHP_5_2 per discussion with Derick. --- diff --git a/NEWS b/NEWS index fbcad3ff05..3ed5dcf693 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ PHP NEWS - Fixed a NULL pointer dereference when processing invalid XML-RPC requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert) +- Fixed bug #51393 (DateTime::createFromFormat() fails if format string contains + timezone). (Adam) - Fixed bug #51338 (URL-Rewriter is still enabled if use_only_cookies is on). (Ilia, j dot jeising at gmail dot com) - Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam) diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index b6958208d0..0ebd6efa06 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sun Mar 7 18:35:25 2010 */ +/* Generated by re2c 0.13.5 on Fri Mar 26 18:06:18 2010 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -469,7 +469,7 @@ static long timelib_parse_tz_cor(char **ptr) char *begin = *ptr, *end; long tmp; - while (**ptr != '\0') { + while (isdigit(**ptr) || **ptr == ':') { ++*ptr; } end = *ptr; diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 53d1adb676..059d73521a 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -467,7 +467,7 @@ static long timelib_parse_tz_cor(char **ptr) char *begin = *ptr, *end; long tmp; - while (**ptr != '\0') { + while (isdigit(**ptr) || **ptr == ':') { ++*ptr; } end = *ptr;