Skip to content

Commit 03b148c

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: date: Fix typo in condition in date_period_init_iso8601_string()
2 parents 78952c7 + 00d7f85 commit 03b148c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5058,7 +5058,7 @@ static bool date_period_init_iso8601_string(php_period_obj *dpobj, zend_class_en
50585058
zend_string_release(func);
50595059
return false;
50605060
}
5061-
if (dpobj->end == NULL && recurrences == 0) {
5061+
if (dpobj->end == NULL && *recurrences == 0) {
50625062
zend_string *func = get_active_function_or_method_name();
50635063
zend_throw_exception_ex(date_ce_date_malformed_period_string_exception, 0, "%s(): ISO interval must contain an end date or a recurrence count, \"%s\" given", ZSTR_VAL(func), isostr);
50645064
zend_string_release(func);

ext/date/tests/date_period_bad_iso_format.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ DateMalformedPeriodStringException: DatePeriod::__construct(): ISO interval must
5050
DateMalformedPeriodStringException: DatePeriod::createFromISO8601String(): ISO interval must contain an interval, "R4/2012-07-01T00:00:00Z" given
5151

5252
Deprecated: Calling DatePeriod::__construct(string $isostr, int $options = 0) is deprecated, use DatePeriod::createFromISO8601String() instead in %s on line %d
53-
DateMalformedPeriodStringException: DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d
54-
DateMalformedPeriodStringException: DatePeriod::createFromISO8601String(): Recurrence count must be greater or equal to 1 and lower than %d
53+
DateMalformedPeriodStringException: DatePeriod::__construct(): ISO interval must contain an end date or a recurrence count, "2012-07-01T00:00:00Z/P7D" given
54+
DateMalformedPeriodStringException: DatePeriod::createFromISO8601String(): ISO interval must contain an end date or a recurrence count, "2012-07-01T00:00:00Z/P7D" given

0 commit comments

Comments
 (0)