don't output the filename url

This commit is contained in:
Christian Mehlmauer
2012-09-16 10:02:36 +02:00
parent 611a6dd377
commit 0adf62d408
2 changed files with 7 additions and 2 deletions

View File

@@ -24,6 +24,11 @@ module WpItem
URI.parse("#{@base_url.to_s}#@wp_content_dir/#@path") URI.parse("#{@base_url.to_s}#@wp_content_dir/#@path")
end end
def get_url_without_filename
uri = get_url
URI.parse("#{uri.scheme}://#{uri.host}#{File.dirname(uri.path)}")
end
def version def version
unless @version unless @version
response = Browser.instance.get(get_url.merge("readme.txt").to_s) response = Browser.instance.get(get_url.merge("readme.txt").to_s)

View File

@@ -195,7 +195,7 @@ begin
plugins.each do |plugin| plugins.each do |plugin|
puts puts
puts " | Name: #{plugin}" #this will also output the version number if detected puts " | Name: #{plugin}" #this will also output the version number if detected
puts " | Location: #{plugin.get_url}" puts " | Location: #{plugin.get_url_without_filename}"
puts " | Directory listing enabled? #{plugin.directory_listing? ? "Yes." : "No."}" puts " | Directory listing enabled? #{plugin.directory_listing? ? "Yes." : "No."}"
plugin.vulnerabilities.each do |vulnerability| plugin.vulnerabilities.each do |vulnerability|
@@ -247,7 +247,7 @@ begin
themes.each do |theme| themes.each do |theme|
puts puts
puts " | Name: #{theme}" #this will also output the version number if detected puts " | Name: #{theme}" #this will also output the version number if detected
puts " | Location: #{theme.get_url}" puts " | Location: #{theme.get_url_without_filename}"
puts " | Directory listing enabled? #{theme.directory_listing? ? "Yes." : "No."}" puts " | Directory listing enabled? #{theme.directory_listing? ? "Yes." : "No."}"
theme.vulnerabilities.each do |vulnerability| theme.vulnerabilities.each do |vulnerability|