1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00

Make sure that item URL are absolute

This commit is contained in:
Frédéric Guillot 2017-12-13 20:16:15 -08:00
parent 84d912c979
commit 827683ab59
8 changed files with 129 additions and 11 deletions

View file

@ -12,6 +12,7 @@ import (
"github.com/miniflux/miniflux/helper"
"github.com/miniflux/miniflux/model"
"github.com/miniflux/miniflux/reader/sanitizer"
"github.com/miniflux/miniflux/url"
)
type rdfFeed struct {
@ -29,13 +30,17 @@ func (r *rdfFeed) Transform() *model.Feed {
for _, item := range r.Items {
entry := item.Transform()
if entry.Author == "" && r.Creator != "" {
entry.Author = sanitizer.StripTags(r.Creator)
}
if entry.URL == "" {
entry.URL = feed.SiteURL
} else {
entryURL, err := url.AbsoluteURL(feed.SiteURL, entry.URL)
if err == nil {
entry.URL = entryURL
}
}
feed.Entries = append(feed.Entries, entry)