Commit f814198
committed
ext/intl: Guard Spoofchecker restriction-level APIs at ICU 53
PHP 8.4.22 fails to build the intl extension against ICU 50.x. The change that
landed for GH-22055 removed the U_ICU_VERSION_MAJOR_NUM >= 58 guards around the
Spoofchecker restriction-level constants (ASCII, HIGHLY_RESTRICTIVE,
MODERATELY_RESTRICTIVE, MINIMALLY_RESTRICTIVE, UNRESTRICTIVE,
SINGLE_SCRIPT_RESTRICTIVE and MIXED_NUMBERS) and the setRestrictionLevel()
method, so the extension references those ICU symbols unconditionally. That is
fine on master and PHP-8.5, where build/php.m4 requires icu-uc >= 57.1, but on
PHP-8.4 the minimum is still icu-uc >= 50.1 and the symbols do not exist that far
back. On a system with ICU 50.x such as Amazon Linux 2 (ICU 50.2, which
satisfies the 50.1 requirement) configure succeeds and the compile then fails
with USPOOF_ASCII, the other restriction-level constants and URestrictionLevel
undeclared.
The correct floor is ICU 53: these symbols, URestrictionLevel and
uspoof_setRestrictionLevel() exist since ICU 51, except
USPOOF_SINGLE_SCRIPT_RESTRICTIVE which was added in ICU 53 and is referenced both
as a constant and in the setRestrictionLevel() body. Guarding at ICU 53 restores
the build on every ICU version PHP-8.4 supports while keeping the
restriction-level API exposed on ICU 53 and later, preserving the intent of
GH-22055 (the previous >= 58 guard was too strict and hid the API on ICU 57.x).1 parent 17f6752 commit f814198
6 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
0 commit comments