Skip to content
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

Make locale parsing less lenient. #26361

Merged
merged 1 commit into from
Aug 28, 2017
Merged

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Aug 24, 2017

The locale field of date fields accepts almost any string and unknown
locales are simply ignored, which is trappy. We should fail on unknown languages
or countries.

This commit also makes - an accepted separator in addition to _ since -
is the recommended separator (https://tools.ietf.org/html/rfc5646#section-2.1).
_ is probably still worth supporting since it is the separator used by
Locale#toString().

@jpountz jpountz added >bug v6.0.0 :Search Foundations/Mapping Index mappings, including merging and defining field types labels Aug 24, 2017
The `locale` field of `date` fields accepts almost any string and unknown
locales are simply ignored, which is trappy. We should fail on unknown languages
or countries.

This commit also makes `-` an accepted separator in addition to `_` since `-`
is the recommended separator (https://tools.ietf.org/html/rfc5646#section-2.1).
`_` is probably still worth supporting since it is the separator used by
`Locale#toString()`.
@jpountz jpountz force-pushed the fix/locale-parsing branch from c64e958 to e63f10d Compare August 24, 2017 13:47
Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to add something to the migration docs but I'm fine with it.

@jpountz
Copy link
Contributor Author

jpountz commented Aug 28, 2017

I'll add a note to the 6.0 migration docs when backporting.

@jpountz jpountz merged commit 262ea95 into elastic:master Aug 28, 2017
@jpountz jpountz deleted the fix/locale-parsing branch August 28, 2017 07:59
jpountz added a commit that referenced this pull request Aug 28, 2017
The `locale` field of `date` fields accepts almost any string and unknown
locales are simply ignored, which is trappy. We should fail on unknown languages
or countries.

This commit also makes `-` an accepted separator in addition to `_` since `-`
is the recommended separator (https://tools.ietf.org/html/rfc5646#section-2.1).
`_` is probably still worth supporting since it is the separator used by
`Locale#toString()`.
jpountz added a commit that referenced this pull request Aug 28, 2017
The `locale` field of `date` fields accepts almost any string and unknown
locales are simply ignored, which is trappy. We should fail on unknown languages
or countries.

This commit also makes `-` an accepted separator in addition to `_` since `-`
is the recommended separator (https://tools.ietf.org/html/rfc5646#section-2.1).
`_` is probably still worth supporting since it is the separator used by
`Locale#toString()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants