From db528b27f4bcbd9d5eb72611ddedc496acfc61c1 Mon Sep 17 00:00:00 2001 From: ethicalhack3r Date: Sat, 5 Sep 2015 13:49:03 +0200 Subject: [PATCH] Implement Erwan's feedback #853 --- lib/common/collections/wp_items/detectable.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/common/collections/wp_items/detectable.rb b/lib/common/collections/wp_items/detectable.rb index 1085e748..8d54234f 100755 --- a/lib/common/collections/wp_items/detectable.rb +++ b/lib/common/collections/wp_items/detectable.rb @@ -172,11 +172,11 @@ class WpItems < Array case type when :vulnerable - items = json.select { |item| !json[item]['vulnerabilities'].empty? } + items = json.select { |item| !json[item]['vulnerabilities'].empty? }.keys when :popular - items = json.select { |item| json[item]['popular'] == true } + items = json.select { |item| json[item]['popular'] == true }.keys when :all - items = [*json] + items = json.keys else raise "Unknown type #{type}" end @@ -184,7 +184,7 @@ class WpItems < Array items.each do |item| targets << create_item( item_class, - item[0], + item, wp_target, vulns_file )