Skip to content

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