diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-01-29 19:10:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-29 19:10:57 +0800 |
| commit | 2e357dddcf4bfe2f1d347bf0b8ff34edbd21fd5e (patch) | |
| tree | 2a9b3bf55dcdc499221cefd37a84ed90ab86c668 /public/js/main.js | |
| parent | 4cc96522c17238211e224fc43d34dcbc335d7436 (diff) | |
| parent | f2e9b102e9911bd385ad2444ae71ee420c70395d (diff) | |
Merge pull request #7 from littleblack111/4-fix-code-scanning-alert-dom-text-reinterpreted-as-html
fixed all cwv by adding a escapeTextReinterpreted function
Diffstat (limited to 'public/js/main.js')
| -rw-r--r-- | public/js/main.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/public/js/main.js b/public/js/main.js index e7a44b6a..323dae9e 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -6,4 +6,7 @@ if ('serviceWorker' in navigator) { console.log('sw.js failed: ', err); }); }); +} +function escapeTextReinterpreted(htmlStr) { + return htmlStr.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); }
\ No newline at end of file |
