Fixes empty username returned in some cases

This commit is contained in:
erwanlr
2019-10-10 20:34:39 +01:00
parent e39a192e8d
commit c47211ca79
3 changed files with 25 additions and 2 deletions

View File

@@ -97,9 +97,12 @@ module WPScan
# @return [ String, nil ]
def display_name_from_body(body)
page = Nokogiri::HTML.parse(body)
# WP >= 3.0
page.css('h1.page-title span').each do |node|
return node.text.to_s
text = node.text.to_s.strip
return text unless text.empty?
end
# WP < 3.0