Commit b800171652f for php.net
commit b800171652f77db35e81961283e6fa5932ab67cc
Merge: 2ef7525be76 630128392b3
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Tue Sep 22 08:29:46 2026 -0400
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
ext/intl: Reject unconstructed Collator in attribute and strength methods
diff --cc NEWS
index 2cb5e45fd70,e7f45c810b2..726f9ac812d
--- a/NEWS
+++ b/NEWS
@@@ -32,8 -32,8 +32,10 @@@ PH
. Fixed cloning IntlDateFormatter and MessageFormatter losing PHP-side state
such as dateType, timeType, calendar and the message pattern.
(Ilia Alshanetsky)
+ . Fixed a crash when converting with a cloned UConverter that uses
+ toUCallback/fromUCallback. (Ilia Alshanetsky)
+ . Fixed Collator attribute and strength methods not rejecting an
+ unconstructed Collator. (Ilia Alshanetsky)
- Lexbor:
. Merge patches lexbor/lexbor@8a14bc0 and lexbor/lexbor@f67ce4b, fixing a
diff --cc ext/intl/collator/collator_class.h
index 311ab5623db,9fdfbb0d01b..106ac926aac
--- a/ext/intl/collator/collator_class.h
+++ b/ext/intl/collator/collator_class.h
@@@ -46,6 -46,22 +46,21 @@@ static inline Collator_object *php_intl
}
#define Z_INTL_COLLATOR_P(zv) php_intl_collator_fetch_object(Z_OBJ_P(zv))
+ static zend_always_inline zend_result collator_check_initialized(Collator_object *co)
+ {
+ ZEND_ASSERT(co != NULL);
+
+ if (UNEXPECTED(co->ucoll == NULL)) {
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
- intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 );
++ intl_errors_set_custom_msg(COLLATOR_ERROR_P( co ), "Object not initialized");
+ zend_throw_error(NULL, "Object not initialized");
+
+ return FAILURE;
+ }
+
+ return SUCCESS;
+ }
+
void collator_register_Collator_symbols(int module_number);
void collator_object_init( Collator_object* co );
void collator_object_destroy( Collator_object* co );