Commit c6f3da1
committed
bug symfony#60888 [Intl] Fix locale validator when canonicalize is true (rdavaillaud)
This PR was merged into the 6.4 branch.
Discussion
----------
[Intl] Fix locale validator when canonicalize is true
| Q | A
| ------------- | ---
| Branch? | 6.4,7.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues |
| License | MIT
When canonicalize is set to true, and the value passed to the validator is not a valid locale, ext-intl Locale::canonicalize should return null.
This is not the case with ICU <76, and this method returns an empty string.
But with the latest ICU lib, this method really returns null.
The problem is with `Locales::exists()` which only accept non null string.
This commit handles the returned null value in the validator.
Commits
-------
fd5b24b [Intl] Fix locale validator when canonicalize is trueFile tree
2 files changed
+16
-1
lines changed- src/Symfony/Component/Validator
- Constraints
- Tests/Constraints
2 files changed
+16
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
94 | 109 | | |
95 | 110 | | |
96 | 111 | | |
| |||
0 commit comments