[php-src] PR #23797: ext/intl: Reject unconstructed Collator in attribute and strength methods
| From: | iliaal | Date: | Sun, 20 Sep 2026 16:13:13 +0000 |
| Subject: | [php-src] PR #23797: ext/intl: Reject unconstructed Collator in attribute and strength methods | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38635@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23797
Author: iliaal
Collator::getAttribute(), setAttribute(), getStrength() and setStrength() reach ICU with a NULL
collator when a subclass skips parent::__construct(), so getAttribute() returns -1 and setStrength()
reports success on an object that cannot collate. The four methods that already check, compare(),
getLocale(), sort() and getSortKey(), throw "Object not initialized"; this applies the
same guard to the remaining four. COLLATOR_METHOD_FETCH_OBJECT does not check on its own.