diff options
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 541fdafea3..6bc5936a74 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -4639,6 +4639,10 @@ PHP_METHOD(DatePeriod, __construct) dpobj->end = clone; } } + + if (dpobj->end == NULL && recurrences < 1) { + php_error_docref(NULL, E_WARNING, "The recurrence count '%d' is invalid. Needs to be > 0", (int) recurrences); + } /* options */ dpobj->include_start_date = !(options & PHP_DATE_PERIOD_EXCLUDE_START_DATE); |