This commit is contained in:
@@ -12,15 +12,15 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
//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
|
||||||
public static List<string> NormalizeTags(List<string> inTags)
|
public static List<string> NormalizeTags(List<string> inTags)
|
||||||
{
|
{
|
||||||
if (inTags == null || inTags.Count == 0) return inTags;
|
if (inTags == null || inTags.Count == 0) return inTags;
|
||||||
|
|
||||||
List<string> outTags = new List<string>();
|
List<string> outTags = new List<string>();
|
||||||
foreach (var tag in inTags)
|
foreach (var tag in inTags)
|
||||||
{
|
|
||||||
outTags.Add(NormalizeTag(tag));
|
outTags.Add(NormalizeTag(tag));
|
||||||
}
|
outTags.Sort();
|
||||||
return outTags.Distinct().ToList();
|
return outTags.Distinct().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user