summaryrefslogtreecommitdiff
path: root/internal/processing/media/update.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-07-13 16:03:51 +0200
committerLibravatar GitHub <noreply@github.com>2021-07-13 16:03:51 +0200
commitbdba3ff9a9f98c1605c01c0e84f6bd6ed5c3efae (patch)
treefaf0be2250d23aec1af6a6d2bcf321d1d8826ba9 /internal/processing/media/update.go
parentBlock/unblock (#96) (diff)
downloadgotosocial-bdba3ff9a9f98c1605c01c0e84f6bd6ed5c3efae.tar.xz
sanitize html for statuses + instance (#97)
* sanitize html for statuses + instance * sanitization
Diffstat (limited to 'internal/processing/media/update.go')
-rw-r--r--internal/processing/media/update.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/processing/media/update.go b/internal/processing/media/update.go
index aa3583054..b5ffc77d8 100644
--- a/internal/processing/media/update.go
+++ b/internal/processing/media/update.go
@@ -26,6 +26,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/util"
)
func (p *processor) Update(account *gtsmodel.Account, mediaAttachmentID string, form *apimodel.AttachmentUpdateRequest) (*apimodel.Attachment, gtserror.WithCode) {
@@ -43,7 +44,7 @@ func (p *processor) Update(account *gtsmodel.Account, mediaAttachmentID string,
}
if form.Description != nil {
- attachment.Description = *form.Description
+ attachment.Description = util.RemoveHTML(*form.Description)
if err := p.db.UpdateByID(mediaAttachmentID, attachment); err != nil {
return nil, gtserror.NewErrorInternalError(fmt.Errorf("database error updating description: %s", err))
}