Fixes for ruby 3

This commit is contained in:
erwanlr
2021-06-08 16:16:10 +02:00
parent 6060fc7a69
commit d14bc739c8
3 changed files with 6 additions and 6 deletions

View File

@@ -162,7 +162,7 @@ module WPScan
# #
# @return [ Typhoeus::Response ] # @return [ Typhoeus::Response ]
def head_and_get(path, codes = [200], params = {}) def head_and_get(path, codes = [200], params = {})
final_path = +@path_from_blog final_path = @path_from_blog.dup # @path_from_blog is set in the plugin/theme
final_path << path unless path.nil? final_path << path unless path.nil?
blog.head_and_get(final_path, codes, params) blog.head_and_get(final_path, codes, params)

View File

@@ -125,14 +125,14 @@ module WPScan
return @uri.to_s unless path return @uri.to_s unless path
if %r{wp-content/plugins}i.match?(path) if %r{wp-content/plugins}i.match?(path)
path = +path.gsub('wp-content/plugins', plugins_dir) new_path = path.gsub('wp-content/plugins', plugins_dir)
elsif /wp-content/i.match?(path) elsif /wp-content/i.match?(path)
path = +path.gsub('wp-content', content_dir) new_path = path.gsub('wp-content', content_dir)
elsif path[0] != '/' && sub_dir elsif path[0] != '/' && sub_dir
path = "#{sub_dir}/#{path}" new_path = "#{sub_dir}/#{path}"
end end
super(path) super(new_path || path)
end end
end end
end end

View File

@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.executables = ['wpscan'] s.executables = ['wpscan']
s.require_paths = ['lib'] s.require_paths = ['lib']
s.add_dependency 'cms_scanner', '~> 0.13.4' s.add_dependency 'cms_scanner', '~> 0.13.5'
s.add_development_dependency 'bundler', '>= 1.6' s.add_development_dependency 'bundler', '>= 1.6'
s.add_development_dependency 'memory_profiler', '~> 1.0.0' s.add_development_dependency 'memory_profiler', '~> 1.0.0'