Skip to content

Commit 3073da9

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/service/GitService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class GitService {
124124
// Simple glob pattern matching
125125
if (pattern.includes("*")) {
126126
const regex = new RegExp(
127-
`^${pattern.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".")}$`,
127+
`^${pattern.replace(/\\/g, "\\\\").replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".")}$`,
128128
);
129129
if (regex.test(filePath)) {
130130
return true;

0 commit comments

Comments
 (0)