Skip to content

Commit 5b54b76

Browse files
Potential fix for code scanning alert no. 106: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 7a052e3 commit 5b54b76

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/create-onchain/scripts/copy-templates.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ function shouldIgnoreFile(filePath, gitignoreRules) {
106106
if (rule.includes('*')) {
107107
// Handle simple wildcards - convert to proper regex
108108
let pattern = rule
109+
.replace(/\\/g, '\\\\') // Escape backslashes
109110
.replace(/\./g, '\\.') // Escape dots
110111
.replace(/\?/g, '.') // ? matches one character
111112
.replace(/\*/g, '[^/]*'); // * matches any characters except /

0 commit comments

Comments
 (0)