[php-src] PR #23520: [intl] Return false from Spoofchecker checks on ICU failure
| From: | iliaal | Date: | Mon, 31 Aug 2026 11:03:07 +0000 |
| Subject: | [php-src] PR #23520: [intl] Return false from Spoofchecker checks on ICU failure | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38230@lists.php.net to get a copy of this message | ||
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.