More rubocop fixes

This commit is contained in:
erwanlr
2020-08-06 12:47:00 +02:00
parent 557dee2d8c
commit 3039d2e7eb
8 changed files with 9 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ module WPScan
def passive(opts = {})
found = []
slugs = items_from_links('themes', false) + items_from_codes('themes', false)
slugs = items_from_links('themes', uniq: false) + items_from_codes('themes', uniq: false)
slugs.each_with_object(Hash.new(0)) { |slug, counts| counts[slug] += 1 }.each do |slug, occurences|
found << Model::Theme.new(slug, target, opts.merge(found_by: found_by, confidence: 2 * occurences))

View File

@@ -9,7 +9,7 @@ module WPScan
# @param [ Boolean ] uniq Wether or not to apply the #uniq on the results
#
# @return [ Array<String> ] The plugins/themes detected in the href, src attributes of the page
def items_from_links(type, uniq = true)
def items_from_links(type, uniq: true)
found = []
xpath = format(
'(//@href|//@src|//@data-src)[contains(., "%s")]',
@@ -31,7 +31,7 @@ module WPScan
# @param [ Boolean ] uniq Wether or not to apply the #uniq on the results
#
# @return [Array<String> ] The plugins/themes detected in the javascript/style of the homepage
def items_from_codes(type, uniq = true)
def items_from_codes(type, uniq: true)
found = []
page_res.html.xpath('//script[not(@src)]|//style[not(@src)]').each do |tag|