1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-11 10:18:28 +09:00

validate unicode for linkpreview

This commit is contained in:
Sergey Cherepanov 2020-08-09 23:39:11 +03:00
parent 47da7758f1
commit ec8b09742c
No known key found for this signature in database
GPG key ID: 085319C64294F576

View file

@ -49,6 +49,12 @@ func (l *linkPreview) Fetch(ctx context.Context, fetchUrl string) (model.LinkPre
if len(res.Description) == 0 {
res.Description = l.findContent(rt.lastBody)
}
if !utf8.ValidString(res.Title) {
res.Title = ""
}
if !utf8.ValidString(res.Description) {
res.Description = ""
}
return res, nil
}