Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSON: Escape percent signs in most strings
A printf-family function is used for flexibility reasons when adding a string to the JSON structure. For this reason any percent signs in strings generated external to the JSON code (object attributes, plugin output, etc.) should have percent signs escaped (to "%%") before being added in the json_*_append_string() functions to prevent the % sign from being interpreted as a format specifier. This commit accomplishes that by passing a structure with the escapes to the json_*_append_string() functions where escaping is desired and a NULL when it is not desired. When json_object_append_string() sees a non-null structure, it calls json_escape_string() on the string before it calls the printf-family function.
- Loading branch information
Eric Stanley
committed
Jun 15, 2014
1 parent
b705897
commit 04c80dd
Showing
5 changed files
with
462 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.