Explorar o código

Use internal XML workarounds to detect feed format

Kebin Liu %!s(int64=6) %!d(string=hai) anos
pai
achega
8cebd985a2
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      reader/parser/format.go

+ 2 - 4
reader/parser/format.go

@@ -8,7 +8,7 @@ import (
 	"encoding/xml"
 	"strings"
 
-	"miniflux.app/reader/encoding"
+	rxml "miniflux.app/reader/xml"
 )
 
 // List of feed formats.
@@ -26,9 +26,7 @@ func DetectFeedFormat(data string) string {
 		return FormatJSON
 	}
 
-	decoder := xml.NewDecoder(strings.NewReader(data))
-	decoder.Entity = xml.HTMLEntity
-	decoder.CharsetReader = encoding.CharsetReader
+	decoder := rxml.NewDecoder(strings.NewReader(data))
 
 	for {
 		token, _ := decoder.Token()