Skip to content

Commit

Permalink
regex changed
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuragNagpure authored and Phil91 committed Jan 15, 2024
1 parent 168f398 commit 6407f2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/framework/Framework.Models/ValidationExpressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}$";
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public async Task AddFavouriteAppForUserAsync(Guid appId)
/// <inheritdoc/>
public async Task<Pagination.Response<OfferCompanySubscriptionStatusResponse>> 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");
}
Expand Down

0 comments on commit 6407f2d

Please sign in to comment.