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

String#convert_to_value should always just return the starting string if the conversion fails #294

Closed
ryanatball opened this issue May 5, 2016 · 1 comment
Labels
bug
Milestone

Comments

@ryanatball
Copy link
Member

@ryanatball ryanatball commented May 5, 2016

Binary data can be incorrectly converted and raise exceptions. For these cases, catch the exception and just return the original string.

@ryanatball ryanatball added the bug label May 5, 2016
@ryanatball
Copy link
Member Author

@ryanatball ryanatball commented May 5, 2016

In general. There were two errors in the code. His input was a binary string that the Array regular expression was matching, and that was then evaled with a syntax error. The spec change tests the eval with a syntax error. The other problem was the use of ^ and $ instead of \A and \z for the regular expressions. I can add a different spec for that.

@ryanatball ryanatball closed this in 52cd0fe May 5, 2016
ryanatball added a commit that referenced this issue May 5, 2016
closes #294. Fix string convert to value
@ryanatball ryanatball modified the milestone: v3.8.1 May 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.