Fix #208 - Fixed vulnerable plugins still appear in the results

This commit is contained in:
erwanlr
2013-07-24 14:18:02 +02:00
parent 73f42bb73d
commit 669e1458da
4 changed files with 36 additions and 5 deletions

View File

@@ -35,7 +35,9 @@ class WpItems < Array
if target_item.exists?(exist_options, response)
if !results.include?(target_item)
results << target_item
if !options[:only_vulnerable] || options[:only_vulnerable] && target_item.vulnerable?
results << target_item
end
end
end
end

View File

@@ -21,6 +21,10 @@ class WpItem
vulnerabilities
end
def vulnerable?
vulnerabilities.empty? ? false : true
end
# Checks if a item is vulnerable to a specific vulnerability
#
# @param [ Vulnerability ] vuln Vulnerability to check the item against