提交 8d24838a 编写于 作者: J Justin Collins

Only create :params, :cookies, :session Sexps once

上级 f232f9b4
...@@ -96,12 +96,17 @@ module Brakeman::Util ...@@ -96,12 +96,17 @@ module Brakeman::Util
nil nil
end end
#These are never modified
PARAMS_SEXP = Sexp.new(:params)
SESSION_SEXP = Sexp.new(:session)
COOKIES_SEXP = Sexp.new(:cookies)
#Adds params, session, and cookies to environment #Adds params, session, and cookies to environment
#so they can be replaced by their respective Sexps. #so they can be replaced by their respective Sexps.
def set_env_defaults def set_env_defaults
@env[PARAMETERS] = Sexp.new(:params) @env[PARAMETERS] = PARAMS_SEXP
@env[SESSION] = Sexp.new(:session) @env[SESSION] = SESSION_SEXP
@env[COOKIES] = Sexp.new(:cookies) @env[COOKIES] = COOKIES_SEXP
end end
#Check if _exp_ represents a hash: s(:hash, {...}) #Check if _exp_ represents a hash: s(:hash, {...})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册