mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-31 21:03:38 +01:00
Fixed: Validation for tags label
This commit is contained in:
parent
cd680a47b5
commit
3aed39dd52
1 changed files with 5 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentValidation;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NzbDrone.Core.Datastore.Events;
|
||||
|
|
@ -22,7 +23,10 @@ public TagController(IBroadcastSignalRMessage signalRBroadcaster,
|
|||
{
|
||||
_tagService = tagService;
|
||||
|
||||
SharedValidator.RuleFor(c => c.Label).NotEmpty();
|
||||
SharedValidator.RuleFor(c => c.Label).Cascade(CascadeMode.Stop)
|
||||
.NotEmpty()
|
||||
.Matches("^[a-z0-9-]+$", RegexOptions.IgnoreCase)
|
||||
.WithMessage("Allowed characters a-z, 0-9 and -");
|
||||
}
|
||||
|
||||
public override TagResource GetResourceById(int id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue