From 74e7eb822e2a788a35e1a8e6486ac32fa1fc1537 Mon Sep 17 00:00:00 2001 From: srgooglo <38926803+srgooglo@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:49:53 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 14: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- scripts/utils/getPackages.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/utils/getPackages.js b/scripts/utils/getPackages.js index 6e7858f9f..b5f75dfc9 100755 --- a/scripts/utils/getPackages.js +++ b/scripts/utils/getPackages.js @@ -18,7 +18,9 @@ async function filterPackages(packages, ignore = []) { // remove comments if (line.startsWith("#")) return - return line.replace(/(\/)/g, "\\/").replace(/(\*)/g, "(.*)") + return line + .replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + .replace(/\\\*/g, "(.*)") }).filter((line) => line) // filter packages that are in the gitignore file