Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] Fix the locale validator so it treats a locale alias as a valid locale#18049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
jakzal commentedMar 7, 2016
| Q | A |
|---|---|
| Branch | 2.3 |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #12583 |
| License | MIT |
| Doc PR | - |
| "doctrine/common":"~2.3", | ||
| "symfony/http-foundation":"~2.1", | ||
| "symfony/intl":"~2.3", | ||
| "symfony/intl":"^2.3.21", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LocaleBundle::getAliases() was introduced in Symfony 2.3.21. Without thistests with--prefer-lowest fail.
| $aliases = Intl::getLocaleBundle()->getAliases(); | ||
| if (!isset($locales[$value])) { | ||
| if (!isset($locales[$value]) && !array_search($value,$aliases)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As we are not interested in the index wouldn't it be make sense to usein_array() instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Obviously :)
xabbuh commentedMar 7, 2016
👍 Status: Reviewed |
webmozart commentedMar 8, 2016
👍 |
fabpot commentedMar 8, 2016
Thank you@jakzal. |
… alias as a valid locale (jakzal)This PR was merged into the 2.3 branch.Discussion----------[Validator] Fix the locale validator so it treats a locale alias as a valid locale| Q | A| ------------- | ---| Branch | 2.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#12583| License | MIT| Doc PR | -Commits-------fbb12d8 [Validator] Fix the locale validator so it treats a locale alias as a valid locale