Skip to content

Commit 06cb30a

Browse files
committed
Remove duplicated code
1 parent 61bdd58 commit 06cb30a

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

lib/msf/http/wordpress/version.rb

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -138,31 +138,6 @@ def check_version_from_readme(type, name, fixed_version, vuln_introduced_version
138138
end
139139
end
140140

141-
def extract_and_check_version(body, type, item_type, fixed_version = nil, vuln_introduced_version = nil)
142-
case type
143-
when :readme
144-
# Try to extract version from readme
145-
# Example line:
146-
# Stable tag: 2.6.6
147-
version = body[/(?:stable tag|version):\s*(?!trunk)([0-9a-z.-]+)/i, 1]
148-
when :style
149-
# Try to extract version from style.css
150-
# Example line:
151-
# Version: 1.5.2
152-
version = body[/(?:Version):\s*([0-9a-z.-]+)/i, 1]
153-
else
154-
fail("Unknown file type #{type}")
155-
end
156-
157-
version_res = extract_and_check_version(res.body.to_s, :readme, type, fixed_version, vuln_introduced_version)
158-
if version_res == Msf::Exploit::CheckCode::Detected && type == :theme
159-
# If no version could be found in readme.txt for a theme, try style.css
160-
return check_theme_version_from_style(name, fixed_version, vuln_introduced_version)
161-
else
162-
return version_res
163-
end
164-
end
165-
166141
def extract_and_check_version(body, type, item_type, fixed_version = nil, vuln_introduced_version = nil)
167142
case type
168143
when :readme

0 commit comments

Comments
 (0)