mirror of
https://github.com/Radarr/Radarr.git
synced 2026-03-05 13:21:25 -05:00
Fixed: Validation for tags label
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NzbDrone.Core.AutoTagging;
|
using NzbDrone.Core.AutoTagging;
|
||||||
@@ -25,7 +26,10 @@ namespace Radarr.Api.V3.Tags
|
|||||||
{
|
{
|
||||||
_tagService = tagService;
|
_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 -");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TagResource GetResourceById(int id)
|
protected override TagResource GetResourceById(int id)
|
||||||
|
|||||||
Reference in New Issue
Block a user