derick Sun Jul 20 20:58:51 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/date/tests bug44562.phpt
Modified files: /php-src/ext/date php_date.c Log: - MFH: Fixed bug #45562 (Creating instance of DatePeriod crashes). http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.51.2.47&r2=1.43.2.45.2.51.2.48&diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.51.2.47 php-src/ext/date/php_date.c:1.43.2.45.2.51.2.48 --- php-src/ext/date/php_date.c:1.43.2.45.2.51.2.47 Sat Jul 19 17:38:29 2008 +++ php-src/ext/date/php_date.c Sun Jul 20 20:58:51 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.45.2.51.2.47 2008/07/19 17:38:29 derick Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.51.2.48 2008/07/20 20:58:51 derick Exp $ */ #include "php.h" #include "php_streams.h" @@ -3555,6 +3555,7 @@ time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB); diobj = (php_interval_obj *) zend_object_store_get_object(return_value TSRMLS_CC); diobj->diff = timelib_rel_time_clone(&time->relative); + diobj->initialized = 1; timelib_time_dtor(time); timelib_error_container_dtor(err); } @@ -3671,7 +3672,7 @@ zval *start, *end = NULL, *interval; long recurrences = 0, options = 0; char *isostr = NULL; - int isostr_len; + int isostr_len = 0; timelib_time *clone; php_set_error_handling(EH_THROW, NULL TSRMLS_CC); @@ -3698,7 +3699,9 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain an end date or a recurrence count.", isostr); } - timelib_update_ts(dpobj->start, NULL); + if (dpobj->start) { + timelib_update_ts(dpobj->start, NULL); + } if (dpobj->end) { timelib_update_ts(dpobj->end, NULL); } http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug44562.phpt?view=markup&rev=1.1 Index: php-src/ext/date/tests/bug44562.phpt +++ php-src/ext/date/tests/bug44562.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php