From d14bc739c8fd663de64082003743b2a954cc9f35 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Tue, 8 Jun 2021 16:16:10 +0200 Subject: [PATCH] Fixes for ruby 3 --- app/models/wp_item.rb | 2 +- .../target/platform/wordpress/custom_directories.rb | 8 ++++---- wpscan.gemspec | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/wp_item.rb b/app/models/wp_item.rb index 62c115cb..340f8f28 100644 --- a/app/models/wp_item.rb +++ b/app/models/wp_item.rb @@ -162,7 +162,7 @@ module WPScan # # @return [ Typhoeus::Response ] 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? blog.head_and_get(final_path, codes, params) diff --git a/lib/wpscan/target/platform/wordpress/custom_directories.rb b/lib/wpscan/target/platform/wordpress/custom_directories.rb index 2b901f91..4d564e9c 100644 --- a/lib/wpscan/target/platform/wordpress/custom_directories.rb +++ b/lib/wpscan/target/platform/wordpress/custom_directories.rb @@ -125,14 +125,14 @@ module WPScan return @uri.to_s unless 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) - path = +path.gsub('wp-content', content_dir) + new_path = path.gsub('wp-content', content_dir) elsif path[0] != '/' && sub_dir - path = "#{sub_dir}/#{path}" + new_path = "#{sub_dir}/#{path}" end - super(path) + super(new_path || path) end end end diff --git a/wpscan.gemspec b/wpscan.gemspec index 95d27bad..0c5e0d3e 100644 --- a/wpscan.gemspec +++ b/wpscan.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.executables = ['wpscan'] 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 'memory_profiler', '~> 1.0.0'