Uses the frozen_string_literal magic comment (will be the default in Ruby 3)

This commit is contained in:
erwanlr
2019-03-21 17:41:29 +00:00
parent 898e8d4546
commit 047a188b34
256 changed files with 512 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
%w[custom_directories].each do |required|
require "wpscan/target/platform/wordpress/#{required}"
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module WPScan
class Target < CMSScanner::Target
module Platform
@@ -111,9 +113,9 @@ module WPScan
return @uri.to_s unless path
if path =~ %r{wp\-content/plugins}i
path.gsub!('wp-content/plugins', plugins_dir)
path = +path.gsub('wp-content/plugins', plugins_dir)
elsif path =~ /wp\-content/i
path.gsub!('wp-content', content_dir)
path = +path.gsub('wp-content', content_dir)
elsif path[0] != '/' && sub_dir
path = "#{sub_dir}/#{path}"
end