aboutsummaryrefslogtreecommitdiff
path: root/server/ui/controller
diff options
context:
space:
mode:
Diffstat (limited to 'server/ui/controller')
-rw-r--r--server/ui/controller/entry.go6
-rw-r--r--server/ui/controller/feed.go1
-rw-r--r--server/ui/controller/subscription.go4
3 files changed, 7 insertions, 4 deletions
diff --git a/server/ui/controller/entry.go b/server/ui/controller/entry.go
index 5c1d3f55..bfbfa705 100644
--- a/server/ui/controller/entry.go
+++ b/server/ui/controller/entry.go
@@ -8,6 +8,8 @@ import (
"errors"
"log"
+ "github.com/miniflux/miniflux2/reader/sanitizer"
+
"github.com/miniflux/miniflux2/integration"
"github.com/miniflux/miniflux2/model"
"github.com/miniflux/miniflux2/reader/scraper"
@@ -46,10 +48,10 @@ func (c *Controller) FetchContent(ctx *core.Context, request *core.Request, resp
return
}
- entry.Content = content
+ entry.Content = sanitizer.Sanitize(entry.URL, content)
c.store.UpdateEntryContent(entry)
- response.JSON().Created(map[string]string{"content": content})
+ response.JSON().Created(map[string]string{"content": entry.Content})
}
// SaveEntry send the link to external services.
diff --git a/server/ui/controller/feed.go b/server/ui/controller/feed.go
index a4b01ee4..c20c1215 100644
--- a/server/ui/controller/feed.go
+++ b/server/ui/controller/feed.go
@@ -222,6 +222,7 @@ func (c *Controller) getFeedFormTemplateArgs(ctx *core.Context, user *model.User
Title: feed.Title,
ScraperRules: feed.ScraperRules,
RewriteRules: feed.RewriteRules,
+ Crawler: feed.Crawler,
CategoryID: feed.Category.ID,
}
} else {
diff --git a/server/ui/controller/subscription.go b/server/ui/controller/subscription.go
index 8b0caf14..754ec42d 100644
--- a/server/ui/controller/subscription.go
+++ b/server/ui/controller/subscription.go
@@ -80,7 +80,7 @@ func (c *Controller) SubmitSubscription(ctx *core.Context, request *core.Request
"errorMessage": "Unable to find any subscription.",
}))
case n == 1:
- feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptions[0].URL)
+ feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptions[0].URL, subscriptionForm.Crawler)
if err != nil {
response.HTML().Render("add_subscription", args.Merge(tplParams{
"form": subscriptionForm,
@@ -117,7 +117,7 @@ func (c *Controller) ChooseSubscription(ctx *core.Context, request *core.Request
return
}
- feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptionForm.URL)
+ feed, err := c.feedHandler.CreateFeed(user.ID, subscriptionForm.CategoryID, subscriptionForm.URL, subscriptionForm.Crawler)
if err != nil {
response.HTML().Render("add_subscription", args.Merge(tplParams{
"form": subscriptionForm,