mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 07:03:02 -06:00
sanitize html for statuses + instance
This commit is contained in:
parent
846057f0d6
commit
a0252502f5
7 changed files with 86 additions and 27 deletions
|
|
@ -264,6 +264,10 @@ func (p *processor) processContent(form *apimodel.AdvancedStatusCreateForm, acco
|
|||
// replace newlines with breaks
|
||||
content = strings.ReplaceAll(content, "\n", "<br />")
|
||||
|
||||
status.Content = content
|
||||
// sanitize html to remove any dodgy scripts or other disallowed elements
|
||||
clean := util.SanitizeHTML(content)
|
||||
|
||||
// set the content as the shiny clean parsed content
|
||||
status.Content = clean
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue