safe navigation operator on res

This commit is contained in:
Alexandre ZANNI
2021-06-25 17:09:20 +02:00
committed by GitHub
parent 6d13f0627e
commit 167e33dac0
@@ -69,7 +69,7 @@ class MetasploitModule < Msf::Exploit::Remote
def find_wmusecurity_id
res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path, blogpath) })
wmusecurity_id = res.body.match(/wmuSecurity":"(\w+)/)&.captures
wmusecurity_id = res&.body.match(/wmuSecurity":"(\w+)/)&.captures
unless wmusecurity_id
fail_with(Failure::NotFound, 'Failed to retrieve the wmusecurity id')
end