mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Disable strict XML parsing
This change should improve parsing of broken XML feeds. See https://golang.org/pkg/encoding/xml/#Decoder
This commit is contained in:
parent
ca48f7612a
commit
36d7732234
8 changed files with 95 additions and 0 deletions
|
@ -633,3 +633,22 @@ func TestParseWithHTMLEntity(t *testing.T) {
|
|||
t.Errorf(`Incorrect title, got: %q`, feed.Title)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseWithInvalidCharacterEntity(t *testing.T) {
|
||||
data := `<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
||||
<channel>
|
||||
<link>https://example.org/a&b</link>
|
||||
<title>Example Feed</title>
|
||||
</channel>
|
||||
</rss>`
|
||||
|
||||
feed, err := Parse(bytes.NewBufferString(data))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if feed.SiteURL != "https://example.org/a&b" {
|
||||
t.Errorf(`Incorrect url, got: %q`, feed.SiteURL)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue