From 6407f2dba98543b0958c964292fe040037e2bdc0 Mon Sep 17 00:00:00 2001 From: AnuragNagpure Date: Thu, 14 Dec 2023 16:00:23 +0530 Subject: [PATCH] regex changed --- src/framework/Framework.Models/ValidationExpressions.cs | 3 +-- .../Apps.Service/BusinessLogic/AppsBusinessLogic.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/framework/Framework.Models/ValidationExpressions.cs b/src/framework/Framework.Models/ValidationExpressions.cs index 47c946c2b0..68cef717f2 100644 --- a/src/framework/Framework.Models/ValidationExpressions.cs +++ b/src/framework/Framework.Models/ValidationExpressions.cs @@ -24,6 +24,5 @@ public static class ValidationExpressions { public const string Name = @"^.+$"; // TODO: should be @"^(([A-Za-zÀ-ÿ]{1,40}?([-,.'\s]?[A-Za-zÀ-ÿ]{1,40}?)){1,8})$"; public const string Bpn = @"^(BPNL|bpnl)[\w|\d]{12}$"; - - public const string Company = @"^[^*+=#%\s]{0,2}[A-Za-zÀ-ÖØ-öø-ÿ&@$€¥0-9.,:;\-'\x22!?«»“”‘’()\/+^%#\\s]{3,40}$"; + public const string Company = @"^\d*?[A-Za-zÀ-ÿ]\d?([A-Za-z0-9À-ÿ-_+=.,:;!?'\x22&#@()]\s?){2,80}$"; } diff --git a/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs b/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs index a569a645e6..1ec53c852e 100644 --- a/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs +++ b/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs @@ -165,7 +165,7 @@ public async Task AddFavouriteAppForUserAsync(Guid appId) /// public async Task> GetCompanyProvidedAppSubscriptionStatusesForUserAsync(int page, int size, SubscriptionStatusSorting? sorting, OfferSubscriptionStatusId? statusId, Guid? offerId, string? companyName) { - if (companyName.IsNullOrEmpty() || !Company.IsMatch(companyName!)) + if (!string.IsNullOrWhiteSpace(companyName) && !Company.IsMatch(companyName)) { throw new ControllerArgumentException("CompanyName length must be 3-40 characters and *+=#%\\s not used as one of the first three characters in the company name"); }