Skip to content

Commit

Permalink
Merge branch 'escape_functionality' of https://github.com/DarkLord017…
Browse files Browse the repository at this point in the history
…/openzeppelin-contracts into escape_functionality
  • Loading branch information
Amxx committed Mar 3, 2025
2 parents dba25a2 + ec41401 commit d18d78d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/utils/Strings.sol
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ library Strings {

/**
* @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.
*
* WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.
*/
function escapeJSON(string memory input) internal pure returns (string memory) {
bytes memory buffer = bytes(input);
Expand Down

0 comments on commit d18d78d

Please sign in to comment.