Typo & indentation
This commit is contained in:
@@ -86,7 +86,7 @@ module WebSite
|
|||||||
redirection
|
redirection
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the MD5 hash of the page given by url
|
# Return the MD5 hash of the page given by url
|
||||||
def self.page_hash(url)
|
def self.page_hash(url)
|
||||||
Digest::MD5.hexdigest(Browser.instance.get(url).body)
|
Digest::MD5.hexdigest(Browser.instance.get(url).body)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ module WpPlugins
|
|||||||
def plugins_from_aggressive_detection(options)
|
def plugins_from_aggressive_detection(options)
|
||||||
options[:file] = options[:file] || (options[:full] ? "#{DATA_DIR}/plugins_full.txt" : "#{DATA_DIR}/plugins.txt")
|
options[:file] = options[:file] || (options[:full] ? "#{DATA_DIR}/plugins_full.txt" : "#{DATA_DIR}/plugins.txt")
|
||||||
options[:vulns_file] = (options[:vulns_file] != nil and options[:vulns_file] != "") ?
|
options[:vulns_file] = (options[:vulns_file] != nil and options[:vulns_file] != "") ?
|
||||||
options[:vulns_file] : DATA_DIR + "/plugin_vulns.xml"
|
options[:vulns_file] : 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[:vulns_xpath_2] = "//plugin"
|
||||||
options[:type] = "plugins"
|
options[:type] = "plugins"
|
||||||
@@ -32,12 +32,12 @@ module WpPlugins
|
|||||||
plugins = []
|
plugins = []
|
||||||
result.each do |r|
|
result.each do |r|
|
||||||
plugins << WpPlugin.new(
|
plugins << WpPlugin.new(
|
||||||
:base_url => r.base_url,
|
:base_url => r.base_url,
|
||||||
:path => r.path,
|
:path => r.path,
|
||||||
:wp_content_dir => r.wp_content_dir,
|
:wp_content_dir => r.wp_content_dir,
|
||||||
:name => r.name,
|
:name => r.name,
|
||||||
:type => "plugins",
|
:type => "plugins",
|
||||||
:wp_plugins_dir => r.wp_plugins_dir
|
:wp_plugins_dir => r.wp_plugins_dir
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
plugins.sort_by { |p| p.name }
|
plugins.sort_by { |p| p.name }
|
||||||
@@ -55,12 +55,12 @@ module WpPlugins
|
|||||||
|
|
||||||
temp.each do |item|
|
temp.each do |item|
|
||||||
plugins << WpPlugin.new(
|
plugins << WpPlugin.new(
|
||||||
:base_url => item.base_url,
|
:base_url => item.base_url,
|
||||||
:name => item.name,
|
:name => item.name,
|
||||||
:path => item.path,
|
:path => item.path,
|
||||||
:wp_content_dir => options[:wp_content_dir],
|
:wp_content_dir => options[:wp_content_dir],
|
||||||
:type => "plugins",
|
:type => "plugins",
|
||||||
:wp_plugins_dir => options[:wp_plugins_dir]
|
:wp_plugins_dir => options[:wp_plugins_dir]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
plugins.sort_by { |p| p.name }
|
plugins.sort_by { |p| p.name }
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ shared_examples_for "WebSite" do
|
|||||||
|
|
||||||
describe "#page_hash" do
|
describe "#page_hash" do
|
||||||
it "should return the MD5 hash of the page" do
|
it "should return the MD5 hash of the page" do
|
||||||
url = "http://e.localhost/somepage.php"
|
url = "http://e.localhost/somepage.php"
|
||||||
body = "Hello World !"
|
body = "Hello World !"
|
||||||
|
|
||||||
stub_request(:get, url).to_return(:body => body)
|
stub_request(:get, url).to_return(:body => body)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user