From: Michael Wallner Date: Wed, 12 May 2010 09:37:25 +0000 (+0000) Subject: Fixed bug #51725 (xmlrpc_get_type() returns true on invalid dates). (Mike) X-Git-Tag: php-5.3.3RC1~178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad1579792584de5869ff3b93981c193d2fb5d1b0;p=php Fixed bug #51725 (xmlrpc_get_type() returns true on invalid dates). (Mike) --- diff --git a/NEWS b/NEWS index 797660d338..8d59a25d9b 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,7 @@ PHP NEWS - Fixed bug #51732 (Fileinfo __construct or open does not work with NULL). (Pierre) +- Fixed bug #51725 (xmlrpc_get_type() returns true on invalid dates). (Mike) - Fixed bug #51723 (Content-length header is limited to 32bit integer with Apache2 on Windows). (Pierre) - Fixed bug #51721 (mark DOMNodeList and DOMNamedNodeMap as Traversable). diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 07cfcec2fb..db15771feb 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1362,10 +1362,16 @@ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb) PHPAPI signed long php_parse_date(char *string, signed long *now) { timelib_time *parsed_time; + timelib_error_container *error = NULL; int error2; signed long retval; - parsed_time = timelib_strtotime(string, strlen(string), NULL, DATE_TIMEZONEDB); + parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB); + if (error->error_count) { + timelib_error_container_dtor(error); + return -1; + } + timelib_error_container_dtor(error); timelib_update_ts(parsed_time, NULL); retval = timelib_date_to_int(parsed_time, &error2); timelib_time_dtor(parsed_time);