diff --git a/src/Radarr.Api.V3/Tags/TagController.cs b/src/Radarr.Api.V3/Tags/TagController.cs index 99ad0f65ed..c6048b2d1e 100644 --- a/src/Radarr.Api.V3/Tags/TagController.cs +++ b/src/Radarr.Api.V3/Tags/TagController.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Text.RegularExpressions; using FluentValidation; using Microsoft.AspNetCore.Mvc; using NzbDrone.Core.AutoTagging; @@ -25,7 +26,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 -"); } protected override TagResource GetResourceById(int id)