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:
|
||||
if node = doc.SelectNode("", "rss"); node != nil {
|
||||
ftype = "rss"
|
||||
major := 0
|
||||
minor := 0
|
||||
version := node.As("", "version")
|
||||
p := strings.Index(version, ".")
|
||||
major, _ := strconv.Atoi(version[0:p])
|
||||
minor, _ := strconv.Atoi(version[p+1 : len(version)])
|
||||
if p != -1 {
|
||||
major, _ = strconv.Atoi(version[0:p])
|
||||
minor, _ = strconv.Atoi(version[p+1 : len(version)])
|
||||
}
|
||||
fversion = [2]int{major, minor}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue