提交 75f8b11f 编写于 作者: martianzhang's avatar martianzhang

add list range check

上级 248b2aef
......@@ -2149,14 +2149,16 @@ func (q *Query4Audit) RuleSpaceWithQuote() Rule {
var rule = q.RuleOK()
for _, tk := range ast.Tokenize(q.Query) {
if tk.Type == ast.TokenTypeQuote {
// 序列化的Val是带引号,所以要取第2个最倒数第二个,这样也就不用担心len<2了。
switch tk.Val[1] {
case ' ':
rule = HeuristicRules["ARG.009"]
}
switch tk.Val[len(tk.Val)-2] {
case ' ':
rule = HeuristicRules["ARG.009"]
if len(tk.Val) >= 2 {
// 序列化的Val是带引号,所以要取第2个和倒数第二个,这样也就不用担心len<2了。
switch tk.Val[1] {
case ' ':
rule = HeuristicRules["ARG.009"]
}
switch tk.Val[len(tk.Val)-2] {
case ' ':
rule = HeuristicRules["ARG.009"]
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册