Skip to content

Commit

Permalink
updated regex for ValidateIdString
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesFinsveen committed Dec 13, 2024
1 parent c0b4545 commit 9dff866
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PCAxis.Sql/ApiUtils/ApiUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ private static string ValidateIdString(string input)
throw new ArgumentException("The id string cannot be null.");
}

if (!Regex.IsMatch(input, @"^[a-zA-Z0-9._\s]+$", RegexOptions.None, TimeSpan.FromSeconds(2)))
if (!Regex.IsMatch(input, @"^[\w\t \-:.]+$", RegexOptions.None, TimeSpan.FromSeconds(2)))
{
throw new ArgumentException("The string contains invalid characters. Only digits, letters, underscores, periods and spaces are allowed.");
throw new ArgumentException("The string contains invalid characters. Only letters, digits, underscores, tabs, spaces, hyphens, colons and periods are allowed.");
}
return input;
}
Expand Down

0 comments on commit 9dff866

Please sign in to comment.