Skip to content

Commit 77efa7c

Browse files
author
HD Moore
committed
Change if/else to case statement
1 parent bfadfda commit 77efa7c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

modules/auxiliary/server/browser_autopwn.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -831,15 +831,13 @@ def build_script_response(cli, request)
831831
# Example: :os_name => ( 'Windows' | /Windows/ | ['Windows', 'Mac OS X'] )
832832
#
833833
def client_matches_module_spec?(client_str, module_spec)
834-
if module_spec.kind_of?(::String)
835-
return !! (client_str == module_spec)
836-
end
837834

838-
if module_spec.kind_of?(::Regexp)
835+
case module_spec
836+
when kind_of? ::String
837+
return !! (client_str == module_spec)
838+
when kind_of? ::Regexp
839839
return !! client_str.match(module_spec)
840-
end
841-
842-
if module_spec.kind_of?(::Array)
840+
when kind_of? ::Array
843841
return !! exploit_spec.map{ |spec|
844842
client_matches_module_spec?(client_str, spec)
845843
}.include?(true)

0 commit comments

Comments
 (0)