mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:52:24 -05:00
[bugfix] Use custom bluemonday policy to disallow inline img tags (#2100)
This commit is contained in:
parent
3aedd937c3
commit
dc96562b40
17 changed files with 243 additions and 78 deletions
|
|
@ -67,7 +67,7 @@ func ogBase(instance *apimodel.InstanceV1) *ogMeta {
|
|||
}
|
||||
|
||||
og := &ogMeta{
|
||||
Title: text.SanitizePlaintext(instance.Title) + " - GoToSocial",
|
||||
Title: text.SanitizeToPlaintext(instance.Title) + " - GoToSocial",
|
||||
Type: "website",
|
||||
Locale: locale,
|
||||
URL: instance.URI,
|
||||
|
|
@ -156,7 +156,7 @@ func parseTitle(account *apimodel.Account, accountDomain string) string {
|
|||
// parseDescription returns a string description which is
|
||||
// safe to use as a template.HTMLAttr inside templates.
|
||||
func parseDescription(in string) string {
|
||||
i := text.SanitizePlaintext(in)
|
||||
i := text.SanitizeToPlaintext(in)
|
||||
i = strings.ReplaceAll(i, "\n", " ")
|
||||
i = strings.Join(strings.Fields(i), " ")
|
||||
i = html.EscapeString(i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue