bugfixing and rspec tests
This commit is contained in:
@@ -30,9 +30,9 @@ class Vulnerable
|
||||
|
||||
xml.xpath(@vulns_xpath).each do |node|
|
||||
vulnerabilities << WpVulnerability.new(
|
||||
node.search('title').text,
|
||||
node.search('reference').text,
|
||||
node.search('type').text
|
||||
node.search("title").text,
|
||||
node.search("reference").text,
|
||||
node.search("type").text
|
||||
)
|
||||
end
|
||||
vulnerabilities
|
||||
|
||||
@@ -28,7 +28,7 @@ class WpItem < Vulnerable
|
||||
@path = options[:path]
|
||||
@name = options[:name] || extract_name_from_url
|
||||
@vulns_xml = options[:vulns_xml]
|
||||
@vulns_xpath = options[:vulns_xpath]
|
||||
@vulns_xpath = options[:vulns_xpath].sub(/\$name\$/, @name)
|
||||
|
||||
raise("url not set") unless @url
|
||||
raise("path not set") unless @path
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
class WpPlugin < WpItem
|
||||
def initialize(options = {})
|
||||
options[:vulns_xml] = options[:vulns_xml] || DATA_DIR + '/plugin_vulns.xml'
|
||||
options[:vulns_xpath] = "//plugin[@name='#@name']/vulnerability"
|
||||
options[:vulns_xpath] = "//plugin[@name='$name$']/vulnerability"
|
||||
options[:vulns_xpath_2] = "//plugin"
|
||||
options[:type] = "plugins"
|
||||
super(options)
|
||||
|
||||
@@ -24,7 +24,7 @@ class WpTheme < WpItem
|
||||
|
||||
def initialize(options = {})
|
||||
options[:vulns_xml] = options[:vulns_xml] || DATA_DIR + '/wp_theme_vulns.xml'
|
||||
options[:vulns_xpath] = "//theme[@name='#@name']/vulnerability"
|
||||
options[:vulns_xpath] = "//theme[@name='$name$']/vulnerability"
|
||||
@version = options[:version]
|
||||
@style_url = options[:style_url]
|
||||
super(options)
|
||||
|
||||
Reference in New Issue
Block a user