1
0

Whoa, don't print a raw unescaped HTML code from guests in a guestbook.

This commit is contained in:
Alexander Andreev 2024-06-19 04:35:25 +04:00
parent c9cd434b59
commit c42e604deb
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -42,11 +42,9 @@ templ Guestbook(captchaID, owner string, entries []*justguestbook.Entry, pageCou
</header>
for _, line := range strings.Split(entry.Message, "\n") {
if len(line) > 0 && line[0] == '>' {
<p class="quote">@templ.Raw(line)
</p>
<p class="quote">{ line }</p>
} else {
<p>@templ.Raw(line)
</p>
<p>{ line }</p>
}
}
if entry.Reply != nil {