From 57411d28bdc6a51a03fca09ad032b159a2d44831 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 24 Nov 2017 10:40:23 -0700 Subject: sanitize header, vlog instead of log some bits in item.go --- models/item/item.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'models/item') diff --git a/models/item/item.go b/models/item/item.go index ebc1214..dba6cd4 100644 --- a/models/item/item.go +++ b/models/item/item.go @@ -2,6 +2,7 @@ package item import ( "adammathes.com/neko/models" + "adammathes.com/neko/vlog" "fmt" "github.com/advancedlogic/GoOse" "github.com/microcosm-cc/bluemonday" @@ -71,7 +72,7 @@ func (i *Item) GetFullContent() { g := goose.New() article, err := g.ExtractFromURL(i.Url) if err != nil { - log.Println(err) + vlog.Println(err) return } @@ -86,6 +87,7 @@ func (i *Item) GetFullContent() { ht, err := article.TopNode.Html() if err != nil { + vlog.Println(err) return } @@ -101,7 +103,7 @@ func (i *Item) GetFullContent() { SET full_content=?, header_image=? WHERE id=?`, md, img, i.Id) if err != nil { - log.Println(err) + vlog.Println(err) } } @@ -168,6 +170,7 @@ func Filter(max_id int64, feed_id int64, unread_only bool, starred_only bool) ([ i.FeedTitle = p.Sanitize(i.FeedTitle) i.FeedUrl = p.Sanitize(i.FeedUrl) i.FullContent = p.Sanitize(i.FullContent) + i.HeaderImage = p.Sanitize(i.HeaderImage) items = append(items, i) } if err = rows.Err(); err != nil { -- cgit v1.2.3