in static render mode do not filter scripts from head content
This commit is contained in:
@ -49,15 +49,15 @@
|
|||||||
|
|
||||||
private string RemoveScripts(string headcontent)
|
private string RemoveScripts(string headcontent)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(headcontent))
|
// if (!string.IsNullOrEmpty(headcontent))
|
||||||
{
|
// {
|
||||||
var index = headcontent.IndexOf("<script");
|
// var index = headcontent.IndexOf("<script");
|
||||||
while (index >= 0)
|
// while (index >= 0)
|
||||||
{
|
// {
|
||||||
headcontent = headcontent.Remove(index, headcontent.IndexOf("</script>") + 9 - index);
|
// headcontent = headcontent.Remove(index, headcontent.IndexOf("</script>") + 9 - index);
|
||||||
index = headcontent.IndexOf("<script");
|
// index = headcontent.IndexOf("<script");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return headcontent;
|
return headcontent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
while (index >= 0)
|
while (index >= 0)
|
||||||
{
|
{
|
||||||
var element = content.Substring(index, content.IndexOf(">", index) - index + 1);
|
var element = content.Substring(index, content.IndexOf(">", index) - index + 1);
|
||||||
if (!string.IsNullOrEmpty(element) && !element.ToLower().StartsWith("<script") && !element.ToLower().StartsWith("</script"))
|
if (!string.IsNullOrEmpty(element) && (PageState.RenderMode == RenderModes.Static || (!element.ToLower().StartsWith("<script") && !element.ToLower().StartsWith("</script"))))
|
||||||
{
|
{
|
||||||
if (!headcontent.Contains(element))
|
if (!headcontent.Contains(element))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user