Rubocopification (unless ... else => if ... else, encoding, Multilines in {} block)
This commit is contained in:
@@ -48,7 +48,7 @@ class CustomOptionParser < OptionParser
|
|||||||
if option.is_a?(Array)
|
if option.is_a?(Array)
|
||||||
option_symbol = CustomOptionParser::option_to_symbol(option)
|
option_symbol = CustomOptionParser::option_to_symbol(option)
|
||||||
|
|
||||||
unless @symbols_used.include?(option_symbol)
|
if !@symbols_used.include?(option_symbol)
|
||||||
@symbols_used << option_symbol
|
@symbols_used << option_symbol
|
||||||
|
|
||||||
self.on(*option) do |arg|
|
self.on(*option) do |arg|
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ describe '#vulnerabilities' do
|
|||||||
let(:location_url) { 'http://example.localhost/' }
|
let(:location_url) { 'http://example.localhost/' }
|
||||||
let(:fixtures_dir) { SPEC_FIXTURES_WPSCAN_WP_PLUGIN_DIR + '/vulnerabilities' }
|
let(:fixtures_dir) { SPEC_FIXTURES_WPSCAN_WP_PLUGIN_DIR + '/vulnerabilities' }
|
||||||
let(:vulns_file) { fixtures_dir + '/plugin_vulns.xml' }
|
let(:vulns_file) { fixtures_dir + '/plugin_vulns.xml' }
|
||||||
let(:wp_plugin) {
|
let(:wp_plugin) do
|
||||||
WpPlugin.new(
|
WpPlugin.new(
|
||||||
base_url: location_url,
|
base_url: location_url,
|
||||||
name: 'spec-plugin',
|
name: 'spec-plugin',
|
||||||
path: 'plugins/spec-plugin/',
|
path: 'plugins/spec-plugin/',
|
||||||
vulns_file: vulns_file
|
vulns_file: vulns_file
|
||||||
)
|
)
|
||||||
}
|
end
|
||||||
|
|
||||||
|
|
||||||
it 'should return an empty array when no vulnerabilities are found' do
|
it 'should return an empty array when no vulnerabilities are found' do
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# encoding: UTF-8
|
||||||
|
|
||||||
#--
|
#--
|
||||||
# WPScan - WordPress Security Scanner
|
# WPScan - WordPress Security Scanner
|
||||||
@@ -54,7 +55,7 @@ begin
|
|||||||
|
|
||||||
# Check for updates
|
# Check for updates
|
||||||
if wpscan_options.update
|
if wpscan_options.update
|
||||||
unless @updater.nil?
|
if !@updater.nil?
|
||||||
if @updater.has_local_changes?
|
if @updater.has_local_changes?
|
||||||
puts "#{red('[!]')} Local file changes detected, an update will override local changes, do you want to continue updating? [y/n]"
|
puts "#{red('[!]')} Local file changes detected, an update will override local changes, do you want to continue updating? [y/n]"
|
||||||
Readline.readline =~ /^y/i ? @updater.reset_head : raise('Update aborted')
|
Readline.readline =~ /^y/i ? @updater.reset_head : raise('Update aborted')
|
||||||
@@ -216,7 +217,7 @@ begin
|
|||||||
puts green('[+]') + ' Enumerating plugins from passive detection ... '
|
puts green('[+]') + ' Enumerating plugins from passive detection ... '
|
||||||
|
|
||||||
plugins = wp_target.plugins_from_passive_detection(base_url: wp_target.uri, wp_content_dir: wp_target.wp_content_dir)
|
plugins = wp_target.plugins_from_passive_detection(base_url: wp_target.uri, wp_content_dir: wp_target.wp_content_dir)
|
||||||
unless plugins.empty?
|
if !plugins.empty?
|
||||||
puts "#{plugins.size} found :"
|
puts "#{plugins.size} found :"
|
||||||
|
|
||||||
plugins.each do |plugin|
|
plugins.each do |plugin|
|
||||||
@@ -251,7 +252,7 @@ begin
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins = wp_target.plugins_from_aggressive_detection(options)
|
plugins = wp_target.plugins_from_aggressive_detection(options)
|
||||||
unless plugins.empty?
|
if !plugins.empty?
|
||||||
puts
|
puts
|
||||||
puts
|
puts
|
||||||
puts green('[+]') + " We found #{plugins.size.to_s} plugins:"
|
puts green('[+]') + " We found #{plugins.size.to_s} plugins:"
|
||||||
@@ -295,7 +296,7 @@ begin
|
|||||||
}
|
}
|
||||||
|
|
||||||
themes = wp_target.themes_from_aggressive_detection(options)
|
themes = wp_target.themes_from_aggressive_detection(options)
|
||||||
unless themes.empty?
|
if !themes.empty?
|
||||||
puts
|
puts
|
||||||
puts
|
puts
|
||||||
puts green('[+]') + " We found #{themes.size.to_s} themes:"
|
puts green('[+]') + " We found #{themes.size.to_s} themes:"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# encoding: UTF-8
|
||||||
|
|
||||||
#--
|
#--
|
||||||
# WPScan - WordPress Security Scanner
|
# WPScan - WordPress Security Scanner
|
||||||
|
|||||||
Reference in New Issue
Block a user