From 0d44721e0424062731c3904f44b6330633c45b2d Mon Sep 17 00:00:00 2001 From: Stephen Date: Thu, 28 Sep 2023 15:55:51 +1000 Subject: [PATCH] Updated to skip comments starting with # --- spec/beef/security_checks_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/beef/security_checks_spec.rb b/spec/beef/security_checks_spec.rb index 9f8bf0cce..c05832311 100644 --- a/spec/beef/security_checks_spec.rb +++ b/spec/beef/security_checks_spec.rb @@ -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