diff --git a/NEWS b/NEWS index 8eaec1a74db9..3413ff97c2b5 100644 --- a/NEWS +++ b/NEWS @@ -8,8 +8,9 @@ PHP NEWS and IntlGregorianCalendar date/time construction. (Weilin Du) . Expose Spoofchecker restriction-level APIs on all supported ICU versions. (Weilin Du) - . Fix SpoofChecker::setAllowedChars() to report PHP constant names - instead of ICU USET_* names in invalid pattern option errors. + . Fix SpoofChecker::setAllowedChars() and IntlDateFormatter::__construct() + to report PHP constant names instead of ICU constant names in + user-visible error messages. (Weilin Du) - MySQLnd: diff --git a/UPGRADING b/UPGRADING index b8be56f77917..50c581695284 100644 --- a/UPGRADING +++ b/UPGRADING @@ -92,8 +92,9 @@ PHP 8.4 UPGRADE NOTES - ValueError if the integer index does not fit in a signed 32 bit integer . IntlDateFormatter::__construct() throws a ValueError if the locale is invalid. . NumberFormatter::__construct() throws a ValueError if the locale is invalid. - . SpoofChecker::setAllowedChars() now reports PHP constant names instead - of ICU USET_* names in invalid pattern option errors. + . SpoofChecker::setAllowedChars() and IntlDateFormatter::__construct() + now report PHP constant names instead of ICU constant names in + user-visible error messages. . MBString: . mb_encode_numericentity() and mb_decode_numericentity() now check that the $map is only composed of integers, if not a ValueError is thrown. diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index c2853bb906f6..086c8678d561 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -103,7 +103,7 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin return FAILURE; } if (date_type == UDAT_PATTERN && time_type != UDAT_PATTERN) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: time format must be UDAT_PATTERN if date format is UDAT_PATTERN", 0); + intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: time format must be IntlDateFormatter::PATTERN if date format is IntlDateFormatter::PATTERN", 0); return FAILURE; } diff --git a/ext/intl/tests/gh12243.phpt b/ext/intl/tests/gh12243.phpt index cb2b17760390..3b7a903a3bfb 100644 --- a/ext/intl/tests/gh12243.phpt +++ b/ext/intl/tests/gh12243.phpt @@ -1,5 +1,5 @@ --TEST-- -GitHub #12043 segfault with IntlDateFormatter::dateType where it equals to UDAT_PATTERN (icu 50) but +GitHub #12043 segfault with IntlDateFormatter::dateType where it equals to IntlDateFormatter::PATTERN (icu 50) but IntldateFormatter::timeType needs to be set as such. --EXTENSIONS-- intl @@ -21,4 +21,4 @@ try { ?> --EXPECT-- -datefmt_create: time format must be UDAT_PATTERN if date format is UDAT_PATTERN: U_ILLEGAL_ARGUMENT_ERROR +datefmt_create: time format must be IntlDateFormatter::PATTERN if date format is IntlDateFormatter::PATTERN: U_ILLEGAL_ARGUMENT_ERROR