This commit is contained in:
@@ -329,10 +329,23 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//Ensure doesn't start or end with a dash
|
//Ensure doesn't start or end with a dash
|
||||||
inObj = inObj.Trim('-');
|
inObj = inObj.Trim('-');
|
||||||
//No longer than 255 characters
|
//No longer than 255 characters
|
||||||
inObj = StringUtil.MaxLength(inObj, 255);
|
inObj = MaxLength(inObj, 255);
|
||||||
return inObj;
|
return inObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Trim a string if necessary
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="s"></param>
|
||||||
|
/// <param name="maxLength"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
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
|
//clean up tags from client submission
|
||||||
//remove dupes, substitute dashes for spaces, lowercase and shorten if exceed 255 chars
|
//remove dupes, substitute dashes for spaces, lowercase and shorten if exceed 255 chars
|
||||||
//and sorts before returning to ensure consistent ordering
|
//and sorts before returning to ensure consistent ordering
|
||||||
|
|||||||
Reference in New Issue
Block a user