提交 f829a8f6 编写于 作者: J Justin Collins

Only accept literals as before_filter method names

whitelist, not blacklist!

This fixes an issue where things like local variables
were being interpreted as method names.

Example:

before_filter :blah, filter_options

"filter_options" was being treated as if it were a method name,
which was wrong.
上级 cd8890ba
......@@ -254,7 +254,7 @@ class Brakeman::ControllerAliasProcessor < Brakeman::AliasProcessor
filter[:methods] = [args[0][1]]
args[1..-1].each do |a|
filter[:methods] << a[1] unless a.node_type == :hash
filter[:methods] << a[1] if a.node_type == :lit
end
if args[-1].node_type == :hash
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册