Skip to content

Commit 18791ce

Browse files
committed
Clean up code
1 parent 5596717 commit 18791ce

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/msf/http/wordpress/version.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ def check_version_from_custom_file(uripath, regex, fixed_version = nil, vuln_int
9797
)
9898

9999
# file not found
100-
return Msf::Exploit::CheckCode::Unknown if res.nil? || res.code != 200
100+
unless res && res.code == 200
101+
return Msf::Exploit::CheckCode::Unknown
102+
end
101103

102-
return extract_and_check_version(res.body.to_s, :custom, 'custom file', fixed_version, vuln_introduced_version, regex)
104+
extract_and_check_version(res.body.to_s, :custom, 'custom file', fixed_version, vuln_introduced_version, regex)
103105
end
104106

105107
private

spec/lib/msf/http/wordpress/version_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@
238238
end
239239
end
240240

241-
242241
describe '#check_version_from_custom_file' do
243242
before :each do
244243
allow(subject).to receive(:send_request_cgi) do |opts|

0 commit comments

Comments
 (0)