Skip to content

Commit 39a7a04

Browse files
committed
Land rapid7#3283, msftidy vars_get check update
Now with more cyan.
2 parents 284b474 + 3f4e9ab commit 39a7a04

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tools/msftidy.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def green
3030
"\e[1;32;40m#{self}\e[0m"
3131
end
3232

33+
def cyan
34+
"\e[1;36;40m#{self}\e[0m"
35+
end
36+
3337
def ascii_only?
3438
self =~ Regexp.new('[\x00-\x08\x0b\x0c\x0e-\x19\x7f-\xff]', nil, 'n') ? false : true
3539
end
@@ -83,6 +87,13 @@ def fixed(txt, line=0)
8387
puts "#{@full_filepath}#{line_msg} - [#{'FIXED'.green}] #{cleanup_text(txt)}"
8488
end
8589

90+
#
91+
# Display an info message. Info messages do not alter the exit status.
92+
#
93+
def info(txt, line=0)
94+
line_msg = (line>0) ? ":#{line}" : ''
95+
puts "#{@full_filepath}#{line_msg} - [#{'INFO'.cyan}] #{cleanup_text(txt)}"
96+
end
8697

8798
##
8899
#
@@ -485,10 +496,10 @@ def check_vuln_codes
485496
end
486497

487498
def check_vars_get
488-
test = @source.scan(/send_request_(?:cgi|raw)\s*\(\s*\{?\s*['"]uri['"]\s*=>\s*[^=})]*?\?[^,})]+/im)
499+
test = @source.scan(/send_request_cgi\s*\(\s*\{?\s*['"]uri['"]\s*=>\s*[^=})]*?\?[^,})]+/im)
489500
unless test.empty?
490501
test.each { |item|
491-
warn("Please use vars_get in send_request_cgi and send_request_raw: #{item}")
502+
info("Please use vars_get in send_request_cgi: #{item}")
492503
}
493504
end
494505
end

0 commit comments

Comments
 (0)