Merge remote-tracking branch 'oqtane/dev' into dev

This commit is contained in:
Leigh Pointer 2023-05-23 17:19:25 +02:00
commit 6668c8ff66

View File

@ -66,15 +66,18 @@
private string AddHeadContent(string headcontent, string content)
{
// format head content, remove scripts, and filter duplicate elements
var elements = (">" + content.Replace("\n", "") + "<").Split("><");
foreach (var element in elements)
if (!string.IsNullOrEmpty(content))
{
if (!string.IsNullOrEmpty(element) && !element.Contains("script"))
// format head content, remove scripts, and filter duplicate elements
var elements = (">" + content.Replace("\n", "") + "<").Split("><");
foreach (var element in elements)
{
if (!headcontent.Contains("<" + element + ">"))
if (!string.IsNullOrEmpty(element) && !element.Contains("script"))
{
headcontent += "<" + element + ">" + "\n";
if (!headcontent.Contains("<" + element + ">"))
{
headcontent += "<" + element + ">" + "\n";
}
}
}
}