Skip to content

Commit

Permalink
Merge pull request #16 from withinJoel/alert-autofix-25
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 25: DOM text reinterpreted as HTML
  • Loading branch information
withinJoel authored Dec 18, 2024
2 parents 38afd46 + 9a4394b commit f773a11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Modules/Packages/Upscale.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import DOMPurify from 'dompurify';
//Upscale
async function upscaleAndDownloadImage(data) {
try {
const imageUrl = imagedir + data;
const sanitizedData = DOMPurify.sanitize(data);
const imageUrl = imagedir + sanitizedData;
const imgOriginal = document.createElement('img');
imgOriginal.src = imageUrl;
imgOriginal.style.position = 'fixed';
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"axios": "^1.7.9",
"electron-context-menu": "^4.0.4"
"electron-context-menu": "^4.0.4",
"dompurify": "^3.2.3"
}
}

0 comments on commit f773a11

Please sign in to comment.