Nokogiri::XML hack to set the default option to NOBLANKS
This commit is contained in:
@@ -23,12 +23,9 @@ class Vulnerable
|
||||
|
||||
# @return an array of WpVulnerability (can be empty)
|
||||
def vulnerabilities
|
||||
xml = Nokogiri::XML(File.open(@vulns_file))
|
||||
vulnerabilities = []
|
||||
|
||||
xml = Nokogiri::XML(File.open(@vulns_file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
|
||||
xml.xpath(@vulns_xpath).each do |node|
|
||||
vulnerabilities << WpVulnerability.new(
|
||||
node.search('title').text,
|
||||
|
||||
@@ -121,9 +121,7 @@ class WpEnumerator
|
||||
|
||||
# Timthumbs have no XML file
|
||||
unless type =~ /timthumbs/i
|
||||
xml = Nokogiri::XML(File.open(vulns_file)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml = Nokogiri::XML(File.open(vulns_file))
|
||||
|
||||
# We check if the plugin name from the plugin_vulns_file is already in targets, otherwise we add it
|
||||
xml.xpath(options[:vulns_xpath_2]).each do |node|
|
||||
|
||||
@@ -146,10 +146,7 @@ class WpVersion < Vulnerable
|
||||
version_xml = options[:version_xml] || WP_VERSIONS_FILE # needed for rpsec
|
||||
wp_content = options[:wp_content_dir]
|
||||
wp_plugins = "#{wp_content}/plugins"
|
||||
|
||||
xml = Nokogiri::XML(File.open(version_xml)) do |config|
|
||||
config.noblanks
|
||||
end
|
||||
xml = Nokogiri::XML(File.open(version_xml))
|
||||
|
||||
xml.xpath('//file').each do |node|
|
||||
file_src = node.attribute('src').text
|
||||
|
||||
Reference in New Issue
Block a user