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

Regular expression for date time format does not escape regexp sensitive characters #90

Open
abhi-patel opened this issue Jul 27, 2017 · 0 comments

Comments

@abhi-patel
Copy link

The method apply regex at https://github.com/clemens/delocalize/blob/master/lib/delocalize/parsers/date_time.rb#L84 does not escape regex sensitive characters. This causes the issue where the original format contain regex sensitive characters such as '.' and hence invalid values gets parsed with invalid formats.

1__ruby

As seen in the screenshot, The format '%d / %m / %y'(the one with slash as separator) should have been picked up, but instead it pickup '%d . %m . %y'(with dot separator) picked up because of '.' character which in regex means anything.

this ends up in invalid date.

abhi-patel added a commit to abhi-patel/delocalize that referenced this issue Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant