diff --git a/StarLight/Controller.cs b/StarLight/Controller.cs
index 58ee1cd..efa9acf 100644
--- a/StarLight/Controller.cs
+++ b/StarLight/Controller.cs
@@ -193,7 +193,7 @@ namespace StarLight.Controllers
html.Append("'>");
html.Append("
");
- Shared.Models.Templates.UtilsTpl.HtmlEncode(item.name, html);
+ HtmlEncode(item.name, html);
html.Append("
");
firstjson = false;
@@ -203,5 +203,24 @@ namespace StarLight.Controllers
return html.ToString();
}
+
+ private static void HtmlEncode(string value, StringBuilder sb)
+ {
+ if (string.IsNullOrEmpty(value))
+ return;
+
+ foreach (var c in value)
+ {
+ switch (c)
+ {
+ case '<': sb.Append("<"); break;
+ case '>': sb.Append(">"); break;
+ case '&': sb.Append("&"); break;
+ case '"': sb.Append("""); break;
+ case '\'': sb.Append("'"); break;
+ default: sb.Append(c); break;
+ }
+ }
+ }
}
}