Updated to skip comments starting with #
This commit is contained in:
@@ -7,7 +7,11 @@ RSpec.describe 'BeEF Security Checks' do
|
||||
next if %r{extensions/dns}.match(path) # skip this file
|
||||
|
||||
f.grep(/\Weval\W/im) do |line|
|
||||
raise "Illegal use of 'eval' found in\n Path: #{path}\nLine: #{line}"
|
||||
# check if comment starting with the '#' character
|
||||
clean_line = line.downcase.gsub(/[ ]/, "")
|
||||
if clean_line[0] != '#' # check first non-whitespace position
|
||||
raise "Illegal use of 'eval' found in\n Path: #{path}\nLine: #{line}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user