php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php_parse_date-return-on-parse-error for XMLRPC-EPI related Bug #51725

Patch version 2010-05-12 09:11 UTC

Return to Bug #51725 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: mike@php.net

Index: ext/date/php_date.c
===================================================================
--- ext/date/php_date.c	(revision 298892)
+++ ext/date/php_date.c	(working copy)
@@ -1361,10 +1361,15 @@
 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) {
+		timelib_error_container_dtor(error);
+		return -1;
+	}
 	timelib_update_ts(parsed_time, NULL);
 	retval = timelib_date_to_int(parsed_time, &error2);
 	timelib_time_dtor(parsed_time);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 09:01:27 2024 UTC