condense logic for matching rank names to numeric value

This commit is contained in:
Erin Bleiweiss 2018-07-27 11:02:25 -05:00
parent c76f141a49
commit df159e957d
1 changed files with 1 additions and 16 deletions

View File

@ -131,22 +131,7 @@ module Msf::Modules::Metadata::Search
matches_rank = module_metadata.rank.to_i == query_rank
end
else
case query_rank
when 'manual'
matches_rank = module_metadata.rank.to_i == Msf::ManualRanking
when 'low'
matches_rank = module_metadata.rank.to_i == Msf::LowRanking
when 'average'
matches_rank = module_metadata.rank.to_i == Msf::AverageRanking
when 'normal'
matches_rank = module_metadata.rank.to_i == Msf::NormalRanking
when 'good'
matches_rank = module_metadata.rank.to_i == Msf::GoodRanking
when 'great'
matches_rank = module_metadata.rank.to_i == Msf::GreatRanking
when 'excellent'
matches_rank = module_metadata.rank.to_i == Msf::ExcellentRanking
end
matches_rank = module_metadata.rank.to_i == Msf::RankingName.key(query_rank)
end
match = [keyword, search_term] if matches_rank
when 'ref', 'ref_name'