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:
parent
47da7758f1
commit
ec8b09742c
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue