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

Fix utf8json escape characters #3679

Merged
merged 1 commit into from
Apr 17, 2019
Merged

Fix utf8json escape characters #3679

merged 1 commit into from
Apr 17, 2019

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Apr 17, 2019

This commit fixes the logic for determining whether a double quote character is escaped when reading inside of a JSON string. the current implementation checks that the previous character is \, and that the character before this is not \, but does not take into account whether that last character itself is part is escaped. The fix is to backtrack from the double quote and count the number of sequential backslash characters; an even number implies that the double quote is not escaped and therefore the end of the JSON string.

This commit fixes the logic for determining whether a double quote character is escaped when reading inside of a JSON string. the current implementation checks that the previous character is \, and that the character before this is not \, but does not take into account whether that last character itself is part is escaped. The fix is to backtrack from the double quote and count the number of sequential backslash characters; an even number implies that the double quote is not escaped and therefore the end of the JSON string.
Copy link
Contributor

@codebrain codebrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submit PR for Utf8Json?

@russcam russcam merged commit 834f2c0 into 7.x Apr 17, 2019
@Mpdreamz Mpdreamz deleted the fix/utf8json-escape-chars branch June 17, 2019 12:05
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

Successfully merging this pull request may close these issues.

2 participants