From ee47731b52964962db0a7d59fd8a67a7ba19e425 Mon Sep 17 00:00:00 2001 From: Weilin Du Date: Mon, 20 Jul 2026 21:18:24 +0800 Subject: [PATCH] ext/intl: Fix various error messages --- NEWS | 4 ++++ ext/intl/common/common_date.cpp | 2 +- ext/intl/normalizer/normalizer_normalize.cpp | 4 ++-- ext/intl/tests/calendar_fromDateTime_error.phpt | 2 +- ext/intl/tests/calendar_setTimeZone_error2.phpt | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index af7d45ecd087..7dd8530af905 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,10 @@ PHP NEWS . Fixed GMP integer string parsing to reject strings containing NUL bytes instead of silently truncating them. (Weilin Du) +- Intl: + . Fixed grammatical issues in Normalizer invalid form and IntlCalendar time + zone offset error messages. (Weilin Du) + - ODBC: . Fixed bug GH-22668 (Heap buffer over-read when a column value exceeds the driver-reported display size). (iliaal) diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index ed18bba70b9f..c9eb45b0f2d9 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -57,7 +57,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone( if (UNEXPECTED(offset_mins <= -24 * 60 || offset_mins >= 24 * 60)) { intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, - "object has an time zone offset that's too large"); + "object has a time zone offset that is too large"); return NULL; } diff --git a/ext/intl/normalizer/normalizer_normalize.cpp b/ext/intl/normalizer/normalizer_normalize.cpp index 8a77d37ad4d4..e5b8db14bafb 100644 --- a/ext/intl/normalizer/normalizer_normalize.cpp +++ b/ext/intl/normalizer/normalizer_normalize.cpp @@ -115,7 +115,7 @@ U_CFUNC PHP_FUNCTION( normalizer_normalize ) case NORMALIZER_FORM_KC_CF: break; default: - zend_argument_value_error(2, "must be a a valid normalization form"); + zend_argument_value_error(2, "must be a valid normalization form"); RETURN_THROWS(); } @@ -232,7 +232,7 @@ U_CFUNC PHP_FUNCTION( normalizer_is_normalized ) case NORMALIZER_FORM_KC_CF: break; default: - zend_argument_value_error(2, "must be a a valid normalization form"); + zend_argument_value_error(2, "must be a valid normalization form"); RETURN_THROWS(); } diff --git a/ext/intl/tests/calendar_fromDateTime_error.phpt b/ext/intl/tests/calendar_fromDateTime_error.phpt index b0a6a6d0fe0c..33d9f9cf1259 100644 --- a/ext/intl/tests/calendar_fromDateTime_error.phpt +++ b/ext/intl/tests/calendar_fromDateTime_error.phpt @@ -35,6 +35,6 @@ DateMalformedStringException: Failed to parse time string (foobar) at position 0 NULL string(88) "IntlCalendar::fromDateTime(): DateTime object is unconstructed: U_ILLEGAL_ARGUMENT_ERROR" NULL -string(103) "IntlCalendar::fromDateTime(): object has an time zone offset that's too large: U_ILLEGAL_ARGUMENT_ERROR" +string(103) "IntlCalendar::fromDateTime(): object has a time zone offset that is too large: U_ILLEGAL_ARGUMENT_ERROR" NULL string(127) "IntlCalendar::fromDateTime(): time zone id 'WEST' extracted from ext/date DateTimeZone not recognized: U_ILLEGAL_ARGUMENT_ERROR" diff --git a/ext/intl/tests/calendar_setTimeZone_error2.phpt b/ext/intl/tests/calendar_setTimeZone_error2.phpt index 6b65aa1a0e7c..277311e0c6b6 100644 --- a/ext/intl/tests/calendar_setTimeZone_error2.phpt +++ b/ext/intl/tests/calendar_setTimeZone_error2.phpt @@ -25,5 +25,5 @@ bool(false) string(126) "IntlCalendar::setTimeZone(): time zone id 'WEST' extracted from ext/date DateTimeZone not recognized: U_ILLEGAL_ARGUMENT_ERROR" string(16) "Europe/Amsterdam" bool(false) -string(102) "IntlCalendar::setTimeZone(): object has an time zone offset that's too large: U_ILLEGAL_ARGUMENT_ERROR" +string(102) "IntlCalendar::setTimeZone(): object has a time zone offset that is too large: U_ILLEGAL_ARGUMENT_ERROR" string(16) "Europe/Amsterdam"