]> granicus.if.org Git - php/commitdiff
Fixed bug #51725 (xmlrpc_get_type() returns true on invalid dates). (Mike)
authorMichael Wallner <mike@php.net>
Wed, 12 May 2010 09:37:25 +0000 (09:37 +0000)
committerMichael Wallner <mike@php.net>
Wed, 12 May 2010 09:37:25 +0000 (09:37 +0000)
NEWS
ext/date/php_date.c

diff --git a/NEWS b/NEWS
index 797660d3381211423df89cd6a554cf3678a02d08..8d59a25d9bba4023bab665802a08de0c68b93056 100644 (file)
--- 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).
index 07cfcec2fb52d24d1f8428012c5d8e3790de5556..db15771feb990392c29db1eacf93a09853d29438 100644 (file)
@@ -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);