[GIT-PULLS] [php-src] PR #23520: [intl] Return false from Spoofchecker checks on ICU failure
[email protected] (iliaal)
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <[email protected]> |
Pull Request: https://github.com/php/php-src/pull/23520 Author: iliaal Spoofchecker::isSuspicious(), ::areConfusable() and ::areBidiConfusable() warn on U_FAILURE and then return true, so an internal ICU failure is indistinguishable from a real detection, and intl_get_error_code() still reads U_ZERO_ERROR because nothing records the code. They now record it and return false, which is what setAllowedChars() and the getSkeleton()/getBidiSkeleton() helpers in the same file already do. I could not reach the U_FAILURE branch from userland: ICU substitutes malformed UTF-8 rather than failing, none of the setters leave a sticky failure code on the object, and the remaining route needs a string over INT32_MAX. So there is no test and no NEWS entry, and this is consistency rather than a fix for something reachable today. Separately, SPOOFCHECKER_CHECK_STATUS in spoofchecker_class.h encodes the same contract and has no call sites anywhere in ext/intl; it can go in a follow-up if you would rather not carry it.