Roadkill.Core.Mvc.ViewModels.PageViewModel.VerifyRawTags C# (CSharp) Method

VerifyRawTags() public static method

Returns false if the tag contains ; / ? : @ & = { } | \ ^ [ ] `
public static VerifyRawTags ( PageViewModel pageViewModel, System.ComponentModel.DataAnnotations.ValidationContext context ) : System.ComponentModel.DataAnnotations.ValidationResult
pageViewModel PageViewModel
context System.ComponentModel.DataAnnotations.ValidationContext
return System.ComponentModel.DataAnnotations.ValidationResult
        public static ValidationResult VerifyRawTags(PageViewModel pageViewModel, ValidationContext context)
        {
            if (string.IsNullOrEmpty(pageViewModel.RawTags))
                return ValidationResult.Success;

            if (_tagBlackList.Any(x => pageViewModel.RawTags.Contains(x)))
            {
                return new ValidationResult("Invalid characters in tag"); // doesn't need to be localized as there's a javascript check
            }
            else
            {
                return ValidationResult.Success;
            }
        }