From c0b4545d5794329f914066eb02c1339af2f15224 Mon Sep 17 00:00:00 2001 From: Johannes Date: Fri, 6 Dec 2024 15:07:50 +0100 Subject: [PATCH] Added space to Regex of ValidateIdString, temporary --- PCAxis.Sql/ApiUtils/ApiUtil.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PCAxis.Sql/ApiUtils/ApiUtil.cs b/PCAxis.Sql/ApiUtils/ApiUtil.cs index fc86511..382ec78 100644 --- a/PCAxis.Sql/ApiUtils/ApiUtil.cs +++ b/PCAxis.Sql/ApiUtils/ApiUtil.cs @@ -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._]+$", RegexOptions.None, TimeSpan.FromSeconds(2))) + if (!Regex.IsMatch(input, @"^[a-zA-Z0-9._\s]+$", RegexOptions.None, TimeSpan.FromSeconds(2))) { - throw new ArgumentException("The string contains invalid characters. Only digits, letters, underscores, and periods are allowed."); + throw new ArgumentException("The string contains invalid characters. Only digits, letters, underscores, periods and spaces are allowed."); } return input; }