From 7f1cd665cac4620d59edee405b1e2460825d157b Mon Sep 17 00:00:00 2001 From: Azareal Date: Thu, 25 Jun 2020 12:36:06 +1000 Subject: [PATCH] fix csps for embeds being reset by next post --- common/topic.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/topic.go b/common/topic.go index 941e0caf..749b6c20 100644 --- a/common/topic.go +++ b/common/topic.go @@ -774,7 +774,11 @@ func (t *TopicUser) Replies(offset int /*pFrag int, */, user *User) (rlist []*Re parseSettings = user.ParseSettings } - r.ContentHtml, externalHead = ParseMessage2(r.Content, t.ParentID, "forums", parseSettings, user) + var eh bool + r.ContentHtml, eh = ParseMessage2(r.Content, t.ParentID, "forums", parseSettings, user) + if eh { + externalHead = true + } // TODO: Do this more efficiently by avoiding the allocations entirely in ParseMessage, if there's nothing to do. if r.ContentHtml == r.Content { r.ContentHtml = r.Content @@ -807,7 +811,11 @@ func (t *TopicUser) Replies(offset int /*pFrag int, */, user *User) (rlist []*Re parseSettings = user.ParseSettings } - r.ContentHtml, externalHead = ParseMessage2(r.Content, t.ParentID, "forums", parseSettings, user) + var eh bool + r.ContentHtml, eh = ParseMessage2(r.Content, t.ParentID, "forums", parseSettings, user) + if eh { + externalHead = true + } // TODO: Do this more efficiently by avoiding the allocations entirely in ParseMessage, if there's nothing to do. if r.ContentHtml == r.Content { r.ContentHtml = r.Content