-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jakzal
commented
Mar 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 | - |
649c17e
to
f3ed390
Compare
f3ed390
to
3854889
Compare
@@ -22,7 +22,7 @@ | |||
"require-dev": { | |||
"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 this tests with --prefer-lowest
fail.
|
||
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 use in_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 :)
3854889
to
fbb12d8
Compare
👍 Status: Reviewed |
👍 |
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