Fixes regexp perf

This commit is contained in:
erwanlr
2019-07-31 14:54:57 +01:00
parent 53fdac1038
commit 8b67dad456
11 changed files with 12 additions and 12 deletions

View File

@@ -14,7 +14,7 @@ end
# @return [ Symbol ]
def classify_slug(slug)
classified = slug.to_s.gsub(/[^a-z\d\-]/i, '-').gsub(/\-{1,}/, '_').camelize.to_s
classified = "D_#{classified}" if classified[0] =~ /\d/
classified = "D_#{classified}" if /\d/.match?(classified[0])
classified.to_sym
end

View File

@@ -29,7 +29,7 @@ module WPScan
end
homepage_res.html.css('meta[name="generator"]').each do |node|
return true if node['content'] =~ /wordpress/i
return true if /wordpress/i.match?(node['content'])
end
return true unless comments_from_page(/wordpress/i, homepage_res).empty?