From 77efa7c19a8b13829bed033de68a13183db5cf42 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Mon, 29 Sep 2014 15:37:58 -0500 Subject: [PATCH] Change if/else to case statement --- modules/auxiliary/server/browser_autopwn.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/auxiliary/server/browser_autopwn.rb b/modules/auxiliary/server/browser_autopwn.rb index f4b2ed16fa..7268531195 100644 --- a/modules/auxiliary/server/browser_autopwn.rb +++ b/modules/auxiliary/server/browser_autopwn.rb @@ -831,15 +831,13 @@ class Metasploit3 < Msf::Auxiliary # Example: :os_name => ( 'Windows' | /Windows/ | ['Windows', 'Mac OS X'] ) # def client_matches_module_spec?(client_str, module_spec) - if module_spec.kind_of?(::String) + + case module_spec + when kind_of? ::String return !! (client_str == module_spec) - end - - if module_spec.kind_of?(::Regexp) + when kind_of? ::Regexp return !! client_str.match(module_spec) - end - - if module_spec.kind_of?(::Array) + when kind_of? ::Array return !! exploit_spec.map{ |spec| client_matches_module_spec?(client_str, spec) }.include?(true)