Skip to content

Commit

Permalink
Escape special characters in JSON key names
Browse files Browse the repository at this point in the history
If a key name includes a special character like a double quote, this should be escaped before outputting as JSON. Fixes #259
  • Loading branch information
joyfullservice committed Sep 23, 2021
1 parent f46de79 commit c139579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Version Control.accda.src/modules/modJsonConverter.bas
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ Public Function ConvertToJson(ByVal JsonValue As Variant, Optional ByVal Whitesp
End If

If json_PrettyPrint Then
json_Converted = vbNewLine & json_Indentation & """" & json_Key & """: " & json_Converted
json_Converted = vbNewLine & json_Indentation & """" & json_Encode(json_Key) & """: " & json_Converted
Else
json_Converted = """" & json_Key & """:" & json_Converted
json_Converted = """" & json_Encode(json_Key) & """:" & json_Converted
End If

json_BufferAppend json_Buffer, json_Converted, json_BufferPosition, json_BufferLength
Expand Down

0 comments on commit c139579

Please sign in to comment.