From b0de1c5a14d6654ae8f72ddf44d2db1dc3494e72 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 9 Aug 2021 19:52:40 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/util.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/util.cs b/source/Plugins/AyaNova.Plugin.V8/util.cs index 8f0b819..a00e11e 100644 --- a/source/Plugins/AyaNova.Plugin.V8/util.cs +++ b/source/Plugins/AyaNova.Plugin.V8/util.cs @@ -329,10 +329,23 @@ namespace AyaNova.PlugIn.V8 //Ensure doesn't start or end with a dash inObj = inObj.Trim('-'); //No longer than 255 characters - inObj = StringUtil.MaxLength(inObj, 255); + inObj = MaxLength(inObj, 255); return inObj; } + /// + /// Trim a string if necessary + /// + /// + /// + /// + public static string MaxLength(string s, int maxLength) + { + if (s.Length > maxLength) + s = s.Substring(0, maxLength); + return s; + } + //clean up tags from client submission //remove dupes, substitute dashes for spaces, lowercase and shorten if exceed 255 chars //and sorts before returning to ensure consistent ordering