Skip to content

Commit

Permalink
Merge pull request #22 from docknetwork/fix/sanitize-number
Browse files Browse the repository at this point in the history
  • Loading branch information
maycon-mello authored Nov 14, 2022
2 parents 72aa7ef + 22a2f41 commit 8eb049e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@docknetwork/prettyvc",
"description": "Render pretty verifiable credentials",
"version": "1.3.9",
"version": "1.3.10",
"main": "lib/index.js",
"license": "MIT",
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions src/utils/sanitize.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
export default function sanitize(str) {
if (!str) {
const strValue = str.toString(); // calling tostring incase of numbers
if (!strValue) {
return '';
}
return str.replace(/&/g, '&')
return strValue.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
Expand Down

0 comments on commit 8eb049e

Please sign in to comment.