lib/cms_scanner/target/platform/php.rb in cms_scanner-0.0.43.2 vs lib/cms_scanner/target/platform/php.rb in cms_scanner-0.0.44.0
- old
+ new
@@ -18,10 +18,10 @@
def log_file?(path, pattern, params = {})
# Only the first 700 bytes of the file are retrieved to avoid getting entire log file
# which can be huge (~ 2Go)
res = head_and_get(path, [200], get: params.merge(headers: { 'Range' => 'bytes=0-700' }))
- res.body =~ pattern ? true : false
+ res.body&.match?(pattern) ? true : false
end
# @param [ String ] path
# @param [ Hash ] params The request params
#