Skip to content

Commit 00d7f85

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: date: Fix typo in condition in date_period_init_iso8601_string()
2 parents c9cb1f9 + f11c1fa commit 00d7f85

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PHP NEWS
66
. Fixed issues with oversized allocations and signed overflow in bcround()
77
and BcMath\Number::round(). (edorian)
88

9+
- Date:
10+
. Fix incorrect recurrence check of DatePeriod::createFromISO8601String().
11+
(ndossche)
12+
913
- GD:
1014
. Fixed bug GH-22121 (Double free in gdImageSetStyle() after
1115
overflow-triggered early return). (iliaal)

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5064,7 +5064,7 @@ static bool date_period_init_iso8601_string(php_period_obj *dpobj, zend_class_en
50645064
zend_string_release(func);
50655065
return false;
50665066
}
5067-
if (dpobj->end == NULL && recurrences == 0) {
5067+
if (dpobj->end == NULL && *recurrences == 0) {
50685068
zend_string *func = get_active_function_or_method_name();
50695069
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);
50705070
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)