Added check to ensure that period is found in version string of RSS node
This commit is contained in:
parent
ddfdb20a68
commit
c01c0416b8
8
feed.go
8
feed.go
|
@ -285,10 +285,14 @@ func (this *Feed) GetVersionInfo(doc *xmlx.Document) (ftype string, fversion [2]
|
||||||
rss:
|
rss:
|
||||||
if node = doc.SelectNode("", "rss"); node != nil {
|
if node = doc.SelectNode("", "rss"); node != nil {
|
||||||
ftype = "rss"
|
ftype = "rss"
|
||||||
|
major := 0
|
||||||
|
minor := 0
|
||||||
version := node.As("", "version")
|
version := node.As("", "version")
|
||||||
p := strings.Index(version, ".")
|
p := strings.Index(version, ".")
|
||||||
major, _ := strconv.Atoi(version[0:p])
|
if p != -1 {
|
||||||
minor, _ := strconv.Atoi(version[p+1 : len(version)])
|
major, _ = strconv.Atoi(version[0:p])
|
||||||
|
minor, _ = strconv.Atoi(version[p+1 : len(version)])
|
||||||
|
}
|
||||||
fversion = [2]int{major, minor}
|
fversion = [2]int{major, minor}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue