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

@@ -20,9 +20,9 @@ module WPScan
enumerate(potential_urls(opts), opts.merge(check_full_response: 200)) do |res|
if res.effective_url.end_with?('.zip')
next unless res.headers['Content-Type'] =~ %r{\Aapplication/zip}i
next unless %r{\Aapplication/zip}i.match?(res.headers['Content-Type'])
else
next unless res.body =~ SQL_PATTERN
next unless SQL_PATTERN.match?(res.body)
end
found << Model::DbExport.new(res.request.url, found_by: DIRECT_ACCESS, confidence: 100)