-
Notifications
You must be signed in to change notification settings - Fork 237
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
Skyhigh173/JSON: fix json_is_valid() #1596
Conversation
The function returns false when valid checked JSON is not whitespace-trimmed. Made it check parsed type.
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.
Code no longer returns false when whitespace is introduced.
Fulfils PR but could break existing projects.
I don't think it'll break projects considering projects would've already accounted for this bug and used non whitespace valid json |
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.
After a bit of thinking, this shouldn't really affect anything unless projects, for some reason, use a rudimentary way of reading the JSON. Though that is doubted, as the get key block is in this extension.
uh this problem is already addressed in #1212 |
Wouldn't additional check for null solve the problem? Previous version worked similar excluding null value, and relied on begin/end characters. |
Just trim trailing and leading white spaces and test it with original script |
So for now it just trims given JSON string before processing it |
okay, i think these blocks need to be replaced but this should be an unambiguous improvement for now |
The function returns false when valid checked JSON is not whitespace-trimmed. Made it check parsed type.