mirror of
https://github.com/pacnpal/simpleguardhome.git
synced 2025-12-20 04:21:13 -05:00
Merge pull request #11 from pacnpal/merge-alert-autofix-4-and-main
Potential fix for code scanning alert no. 4: DOM text reinterpreted as HTML
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.4/purify.min.js" integrity="sha384-KGmzmwrs7oAU2sG5qfETslFsscVcCaxQrX2d7PW7I9bTrsuTD/eSMFr9jaMS9i+b" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
function escapeHtml(unsafe) {
|
||||
return unsafe
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
return unsafe.replace(/[&<"']/g, function (m) {
|
||||
switch (m) {
|
||||
case '&': return '&';
|
||||
|
||||
Reference in New Issue
Block a user