summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2017-01-13 15:14:25 +0100
committerAlex Legler <alex@a3li.li>2017-01-13 15:14:25 +0100
commitefe905f7f677fd300d62cd76d3f906e7552f8e9b (patch)
tree2ab164fdee7696e4761df7c0655709c47db35420
parentCopyright: 2017 (diff)
downloadsecurity-efe905f7f677fd300d62cd76d3f906e7552f8e9b.tar.gz
security-efe905f7f677fd300d62cd76d3f906e7552f8e9b.tar.bz2
security-efe905f7f677fd300d62cd76d3f906e7552f8e9b.zip
Support <revised count="">
-rw-r--r--lib/glsav1.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/glsav1.rb b/lib/glsav1.rb
index d2c1692..9da61a2 100644
--- a/lib/glsav1.rb
+++ b/lib/glsav1.rb
@@ -11,8 +11,14 @@ class GLSAv1
@synopsis = text_content xml, '/glsa/synopsis/text()'
@product = text_content xml, '/glsa/product/text()'
@date = DateTime.parse(xml.xpath('/glsa/announced/text()').first.content)
- @revised,
- @revision = xml.xpath('/glsa/revised/text()').first.content.split(': ')
+
+ if xml.xpath('/glsa/revised').first['count'].nil?
+ @revised,
+ @revision = xml.xpath('/glsa/revised/text()').first.content.split(': ')
+ else
+ @revised = xml.xpath('/glsa/revised/text()').first.content
+ @revision = xml.xpath('/glsa/revised').first['count']
+ end
@revised = DateTime.parse(@revised)
@bugs = xml.xpath('/glsa/bug/text()').map { |bug_node| bug_node.content.to_i }