diff --git a/src/Umbraco.Web.UI.Client/src/views/macros/create.html b/src/Umbraco.Web.UI.Client/src/views/macros/create.html
index 9406c71064..bed989f571 100644
--- a/src/Umbraco.Web.UI.Client/src/views/macros/create.html
+++ b/src/Umbraco.Web.UI.Client/src/views/macros/create.html
@@ -19,7 +19,8 @@
-
+
diff --git a/src/Umbraco.Web/Editors/MacrosController.cs b/src/Umbraco.Web/Editors/MacrosController.cs
index d7d50236d5..429e8b6190 100644
--- a/src/Umbraco.Web/Editors/MacrosController.cs
+++ b/src/Umbraco.Web/Editors/MacrosController.cs
@@ -62,6 +62,11 @@ namespace Umbraco.Web.Editors
return this.ReturnErrorResponse("Macro with this alias already exists");
}
+ if (name == null || name.Length > 255)
+ {
+ return this.ReturnErrorResponse("Name cannnot be more than 255 characters in length.");
+ }
+
try
{
var macro = new Macro
@@ -149,6 +154,11 @@ namespace Umbraco.Web.Editors
return this.ReturnErrorResponse($"No macro data found in request");
}
+ if (macroDisplay.Name == null || macroDisplay.Name.Length > 255)
+ {
+ return this.ReturnErrorResponse("Name cannnot be more than 255 characters in length.");
+ }
+
var macro = _macroService.GetById(int.Parse(macroDisplay.Id.ToString()));
if (macro == null)