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

Comments

Projects
None yet
1 participant
@ryanatball
Member

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

This comment has been minimized.

Show comment
Hide comment
@ryanatball

ryanatball May 5, 2016

Member

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.

Member

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

@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