Patch date-period-ctor-75002.txt.diff for SPL related Bug #75002
Patch version 2017-07-28 11:40 UTC
Return to Bug #75002 |
Download this patch
Patch Revisions:
Developer: derick@php.net
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index dcc71a402b..fb98fab893 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1944,6 +1944,10 @@ static void date_period_it_rewind(zend_object_iterator *iter)
if (iterator->object->current) {
timelib_time_dtor(iterator->object->current);
}
+ if (!iterator->object->start) {
+ zend_throw_error(NULL, "DatePeriod has not been initialized correctly");
+ return;
+ }
iterator->object->current = timelib_time_clone(iterator->object->start);
date_period_it_invalidate_current(iter);
}
|