From f5fe79326a92a16fd466aeadfb84a514c233ed4c Mon Sep 17 00:00:00 2001 From: n1474335 Date: Thu, 14 Apr 2022 16:57:46 +0100 Subject: [PATCH] CodeQL fixes --- src/core/Utils.mjs | 4 ++-- src/core/operations/ToBase45.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index c48c484c..66a98c36 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -723,8 +723,8 @@ class Utils { } if (removeScriptAndStyle) { - htmlStr = recursiveRemove(/]*>.*?<\/script>/gi, htmlStr); - htmlStr = recursiveRemove(/]*>.*?<\/style>/gi, htmlStr); + htmlStr = recursiveRemove(/]*>.*?<\/script[^>]*>/gi, htmlStr); + htmlStr = recursiveRemove(/]*>.*?<\/style[^>]*>/gi, htmlStr); } return htmlStr.replace(/<[^>]+>/g, ""); } diff --git a/src/core/operations/ToBase45.mjs b/src/core/operations/ToBase45.mjs index 40dd96de..3246ab4e 100644 --- a/src/core/operations/ToBase45.mjs +++ b/src/core/operations/ToBase45.mjs @@ -43,9 +43,9 @@ class ToBase45 extends Operation { * @returns {string} */ run(input, args) { + if (!input) return ""; input = new Uint8Array(input); const alphabet = Utils.expandAlphRange(args[0]); - if (!input) return ""; const res = [];