Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
Brakeman
提交
f5580a05
B
Brakeman
项目概览
李少辉-开发者
/
Brakeman
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
Brakeman
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f5580a05
编写于
8月 14, 2012
作者:
J
Justin Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CSC] Use methods in CheckSelectTag and CheckSingleQuotes
上级
18022b7b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
10 deletion
+10
-10
lib/brakeman/checks/check_select_tag.rb
lib/brakeman/checks/check_select_tag.rb
+2
-2
lib/brakeman/checks/check_single_quotes.rb
lib/brakeman/checks/check_single_quotes.rb
+8
-8
未找到文件。
lib/brakeman/checks/check_select_tag.rb
浏览文件 @
f5580a05
...
...
@@ -38,12 +38,12 @@ class Brakeman::CheckSelectTag < Brakeman::BaseCheck
add_result
result
#Only concerned if user input is supplied for :prompt option
last_arg
=
result
[
:call
]
[
3
][
-
1
]
last_arg
=
result
[
:call
]
.
arglist
.
last
if
hash
?
last_arg
prompt_option
=
hash_access
last_arg
,
:
prompt
if
call?
prompt_option
and
@ignore_methods
.
include?
prompt_option
[
2
]
if
call?
prompt_option
and
@ignore_methods
.
include?
prompt_option
.
method
return
elsif
sexp?
prompt_option
and
input
=
include_user_input?
(
prompt_option
)
...
...
lib/brakeman/checks/check_single_quotes.rb
浏览文件 @
f5580a05
...
...
@@ -50,9 +50,9 @@ class Brakeman::CheckSingleQuotes < Brakeman::BaseCheck
#
# class ERB
def
process_class
exp
if
exp
[
1
]
==
:ERB
if
exp
.
class_name
==
:ERB
@inside_erb
=
true
process
exp
[
-
1
]
process
exp
.
body
@inside_erb
=
false
end
...
...
@@ -63,9 +63,9 @@ class Brakeman::CheckSingleQuotes < Brakeman::BaseCheck
#
# module Util
def
process_module
exp
if
@inside_erb
and
exp
[
1
]
==
:Util
if
@inside_erb
and
exp
.
class_name
==
:Util
@inside_util
=
true
process
exp
[
-
1
]
process
exp
.
body
@inside_util
=
false
end
...
...
@@ -76,9 +76,9 @@ class Brakeman::CheckSingleQuotes < Brakeman::BaseCheck
#
# def html_escape
def
process_defn
exp
if
@inside_util
and
exp
[
1
]
==
:html_escape
if
@inside_util
and
exp
.
meth_name
==
:html_escape
@inside_html_escape
=
true
process
exp
[
-
1
]
process
exp
.
body
@inside_html_escape
=
false
end
...
...
@@ -89,10 +89,10 @@ class Brakeman::CheckSingleQuotes < Brakeman::BaseCheck
#
# Rack::Utils.escape_html
def
process_call
exp
if
@inside_html_escape
and
exp
[
1
]
==
RACK_UTILS
and
exp
[
2
]
==
:escape_html
if
@inside_html_escape
and
exp
.
target
==
RACK_UTILS
and
exp
.
method
==
:escape_html
@uses_rack_escape
=
true
else
process
exp
[
1
]
if
exp
[
1
]
process
exp
.
target
if
exp
.
target
end
exp
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录