Nokogiri::XML hack to set the default option to NOBLANKS
This commit is contained in:
@@ -46,9 +46,7 @@ class CheckerPlugin < Plugin
|
||||
puts '[+] Checking vulnerabilities reference urls'
|
||||
|
||||
vuln_ref_files.each do |vuln_ref_file|
|
||||
xml = Nokogiri::XML(File.open(vuln_ref_file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml = Nokogiri::XML(File.open(vuln_ref_file))
|
||||
|
||||
urls = []
|
||||
xml.xpath('//reference').each { |node| urls << node.text }
|
||||
@@ -113,9 +111,7 @@ class CheckerPlugin < Plugin
|
||||
|
||||
puts '[+] Checking for vulnerable files ...'
|
||||
|
||||
xml = Nokogiri::XML(File.open(xml_file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml = Nokogiri::XML(File.open(xml_file))
|
||||
|
||||
xml.xpath('//hash').each do |node|
|
||||
sha1sum = node.attribute('sha1').text
|
||||
|
||||
@@ -44,32 +44,24 @@ class StatsPlugin < Plugin
|
||||
end
|
||||
end
|
||||
|
||||
def xml(file)
|
||||
Nokogiri::XML(File.open(file))
|
||||
end
|
||||
|
||||
def vuln_plugin_count(file=PLUGINS_VULNS_FILE)
|
||||
xml = Nokogiri::XML(File.open(file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml.xpath("count(//plugin)").to_i
|
||||
self.xml(file).xpath("count(//plugin)").to_i
|
||||
end
|
||||
|
||||
def vuln_theme_count(file=THEMES_VULNS_FILE)
|
||||
xml = Nokogiri::XML(File.open(file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml.xpath("count(//theme)").to_i
|
||||
self.xml(file).xpath("count(//theme)").to_i
|
||||
end
|
||||
|
||||
def plugin_vulns_count(file=PLUGINS_VULNS_FILE)
|
||||
xml = Nokogiri::XML(File.open(file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml.xpath("count(//vulnerability)").to_i
|
||||
self.xml(file).xpath("count(//vulnerability)").to_i
|
||||
end
|
||||
|
||||
def theme_vulns_count(file=THEMES_VULNS_FILE)
|
||||
xml = Nokogiri::XML(File.open(file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml.xpath("count(//vulnerability)").to_i
|
||||
self.xml(file).xpath("count(//vulnerability)").to_i
|
||||
end
|
||||
|
||||
def total_plugins(file=PLUGINS_FULL_FILE, xml=PLUGINS_VULNS_FILE)
|
||||
|
||||
Reference in New Issue
Block a user