From 0a2ec7649653461d015cfe245ecf285ef3662194 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 | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/framework/Framework.Models/ValidationExpressions.cs b/src/framework/Framework.Models/ValidationExpressions.cs index 47c946c2b0..94d446ded3 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?){3,80}$"; } diff --git a/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs b/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs index a569a645e6..ce7ef41776 100644 --- a/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs +++ b/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs @@ -19,8 +19,6 @@ ********************************************************************************/ using Microsoft.Extensions.Options; -using Microsoft.IdentityModel.Tokens; -using Offers.Library.Extensions; using Offers.Library.Extensions; using Org.Eclipse.TractusX.Portal.Backend.Apps.Service.ViewModels; using Org.Eclipse.TractusX.Portal.Backend.Framework.ErrorHandling; @@ -165,7 +163,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"); }