From b6b2b2d5d684746192e843917c3dfe6a480c88c5 Mon Sep 17 00:00:00 2001 From: Bubbo <85169821+xbubbo@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:55:46 -0500 Subject: [PATCH] Fix code scanning alert no. 10: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- randomize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randomize.ts b/randomize.ts index 23c1c3f..9834baa 100644 --- a/randomize.ts +++ b/randomize.ts @@ -199,7 +199,7 @@ export function UpdateImports() { OriginalPatterns.forEach((pattern, index) => { content = content.replace( - new RegExp(`['"]${pattern.replace(/\./g, "\\.")}['"]`, "g"), + new RegExp(`['"]${pattern.replace(/\\/g, "\\\\").replace(/\./g, "\\.")}['"]`, "g"), `'${NewPatterns[index]}'`, ); });