lib/pwn/sast/inner_html.rb in pwn-0.4.516 vs lib/pwn/sast/inner_html.rb in pwn-0.4.517
- old
+ new
@@ -21,21 +21,22 @@
git_repo_root_uri = opts[:git_repo_root_uri].to_s.scrub
result_arr = []
logger_results = ''
PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
- if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/
+ if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
line_no_and_contents_arr = []
entry_beautified = false
if File.extname(entry) == '.js' && (`wc -l #{entry}`.split.first.to_i < 20 || entry.include?('.min.js') || entry.include?('-all.js'))
js_beautify = `js-beautify #{entry} > #{entry}.JS-BEAUTIFIED`.to_s.scrub
entry = "#{entry}.JS-BEAUTIFIED"
entry_beautified = true
end
test_case_filter = "
- grep -n 'innerHTML' #{entry}
+ grep -n \
+ -e 'innerHTML' #{entry}
"
str = `#{test_case_filter}`.to_s.scrub
if str.to_s.empty?