Last attempt to try and satisfy CodeQL

This commit is contained in:
Glenn R. Martin 2025-06-09 00:17:39 -04:00
parent e6a50df732
commit 46799891d0

View file

@ -134,7 +134,8 @@ class ParseAITokens extends Operation {
*/
replaceSpacesOutsideTags(htmlString) {
return htmlString
.replace(/(<script\b[^>]*>.*?<\/script>)|(<[^>]*?>)|(\s+)/gi, (match, scriptTag, htmlTag, spaces) => {
.replace(/<script/ig, "&lt;script")
.replace(/(&lt;script\b[^>]*>.*?<\/script>)|(<[^>]*?>)|(\s+)/gi, (match, scriptTag, htmlTag, spaces) => {
if (scriptTag) {
// Sanitize the <script> tag by escaping it
return scriptTag
@ -148,7 +149,6 @@ class ParseAITokens extends Operation {
return "";
}
})
.replace(/<script/ig, "&lt;script") // satisfy codeql
.replace(/[\r\n]/g, "");
}