Add WP metadata #704

This commit is contained in:
ethicalhack3r
2016-04-20 12:02:15 +02:00
parent bf99e31e70
commit 1d6593fd4d
2 changed files with 15 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ class WpVersion < WpItem
include WpVersion::Output
# The version number
attr_accessor :number
attr_accessor :number, :metadata
alias_method :version, :number # Needed to have the right behaviour in Vulnerable#vulnerable_to?
# @return [ Array ]
@@ -35,4 +35,14 @@ class WpVersion < WpItem
a << node.text.to_s
end
end
# @return [ Hash ] All metadata from version_file
def metadata(version)
json = json(WORDPRESSES_FILE)
metadata = {}
metadata[:release_date] = json[version]['release_date']
metadata[:changelog_url] = json[version]['changelog_url']
metadata
end
end