mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
sanitize html for statuses + instance (#97)
* sanitize html for statuses + instance * sanitization
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user