diff --git a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs
index 387fc670b8..fa82bc555c 100644
--- a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs
@@ -1,4 +1,6 @@
using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.Linq;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
@@ -7,6 +9,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.PropertyEditors.Validators;
using Umbraco.Core.Services;
namespace Umbraco.Web.PropertyEditors
@@ -86,7 +89,7 @@ namespace Umbraco.Web.PropertyEditors
///
///
///
- ///
+ ///
///
///
///
@@ -97,10 +100,40 @@ namespace Umbraco.Web.PropertyEditors
var val = property.GetValue(culture, segment);
return val?.ToString().Split(new[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
.Select(x => JObject.FromObject(new {value = x})) ?? new JObject[] { };
-
-
}
+ ///
+ /// A custom FormatValidator is used as for multiple text strings, each string should individually be checked
+ /// against the configured regular expression, rather than the JSON representing all the strings as a whole.
+ ///
+ public override IValueFormatValidator FormatValidator => new MultipleTextStringFormatValidator();
+ }
+
+ internal class MultipleTextStringFormatValidator : IValueFormatValidator
+ {
+ public IEnumerable ValidateFormat(object value, string valueType, string format)
+ {
+ var asArray = value as JArray;
+ if (asArray == null)
+ {
+ return Enumerable.Empty();
+ }
+
+ var textStrings = asArray.OfType()
+ .Where(x => x["value"] != null)
+ .Select(x => x["value"].Value());
+ var textStringValidator = new RegexValidator();
+ foreach (var textString in textStrings)
+ {
+ var validationResults = textStringValidator.ValidateFormat(textString, valueType, format).ToList();
+ if (validationResults.Any())
+ {
+ return validationResults;
+ }
+ }
+
+ return Enumerable.Empty();
+ }
}
}
}