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
Fix Inf and NaN regex when using WithAttemptingUnquotedStringTypeDeserialization #730
Conversation
@@ -381,7 +381,7 @@ private static object CastInteger(ulong number, TypeCode typeCode) | |||
result = v; | |||
} | |||
} | |||
else if (Regex.IsMatch(v, @"[-+]?(\.inf|\.Inf|\.INF)")) //infinities | |||
else if (Regex.IsMatch(v, @"^[-+]?(\.inf|\.Inf|\.INF)$")) //infinities |
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.
We don't allow for whitespace before or after, but I am guessing the string is trimmed long before it gets here.
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.
In all my testing it's trimmed, but I don't know the code well enough to know if that's a guarantee.
These changes make sense to me. One small comment. |
/assign @EdwardCooke |
@jpricket @lkillgore The build failed so I can't merge this in. I'll try and look into it tonight. It may have been a fluke and just need to be requeued. When I get it merged in, I'll cut a new release. |
Thanks, @edwardcookemacu! I looked at the build failure, and it looks like it's the same one in this PR, which appears to be a transient failure AFAICT. |
This seems to be an issue with GitVersion. Sometimes it happens, but I've never been able to figure out why it happens. It's not easy to debug because locally it's difficult to reproduce and GitVersion is very fragile. |
This feature has been released in version 12.0.2. |
Fixes #729.
Deserializing .INF and .NAN using WithAttemptingUnquotedStringTypeDeserialization