aboutsummaryrefslogtreecommitdiffstats
path: root/models/item
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-11-24 10:40:23 -0700
committerAdam Mathes <adam@trenchant.org>2017-11-24 10:40:23 -0700
commit57411d28bdc6a51a03fca09ad032b159a2d44831 (patch)
tree21d4e788d94fef2c17e47f6852603b2bde4dfda8 /models/item
parentee46ed7c3c3da4f3630ffc430527c0a9e54abeb0 (diff)
downloadneko-57411d28bdc6a51a03fca09ad032b159a2d44831.tar.gz
neko-57411d28bdc6a51a03fca09ad032b159a2d44831.tar.bz2
neko-57411d28bdc6a51a03fca09ad032b159a2d44831.zip
sanitize header, vlog instead of log some bits in item.go
Diffstat (limited to 'models/item')
-rw-r--r--models/item/item.go7
1 files changed, 5 insertions, 2 deletions
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 {