Skip to content

Commit

Permalink
Fix code scanning alert no. 1: Incomplete string escaping or encoding
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
jthrilly and github-advanced-security[bot] authored Nov 1, 2024
1 parent d3bb03d commit 758cbaf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/validation/Validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { ValidationError } from "..";
const ensurePatternRegExp = (pattern: string | RegExp): RegExp => {
if (typeof pattern === "string") {
const re = pattern
.replace(/\\/g, "\\\\")
.replace(/\./g, "\\.")
.replace(/\*/g, "[^.]+")
.replace(/\[\]/g, ".?\\[\\d+\\]");
Expand Down

0 comments on commit 758cbaf

Please sign in to comment.