File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -102,16 +102,14 @@ private predicate hasBooleanValue(DataFlow::Node node, boolean value) {
102
102
103
103
// `<actionControllerConfig>.allow_forgery_protection = <verificationSetting>`
104
104
private DataFlow:: CallNode getAnAllowForgeryProtectionCall ( boolean verificationSetting ) {
105
- exists ( ActionControllerConfigNode recv |
106
- // exclude some test and development configuration
107
- not (
108
- result .getLocation ( ) .getFile ( ) .getRelativePath ( ) .matches ( "%test/%" ) or
109
- result .getLocation ( ) .getFile ( ) .getStem ( ) = [ "test" , "development" ]
110
- ) and
111
- result .getReceiver ( ) = recv and
112
- result .asExpr ( ) .getExpr ( ) .( MethodCall ) .getMethodName ( ) = "allow_forgery_protection=" and
113
- hasBooleanValue ( result .getArgument ( 0 ) , verificationSetting )
114
- )
105
+ // exclude some test and development configuration
106
+ not (
107
+ result .getLocation ( ) .getFile ( ) .getRelativePath ( ) .matches ( "%test/%" ) or
108
+ result .getLocation ( ) .getFile ( ) .getStem ( ) = [ "test" , "development" ]
109
+ ) and
110
+ result .getReceiver ( ) instanceof ActionControllerConfigNode and
111
+ result .asExpr ( ) .getExpr ( ) .( MethodCall ) .getMethodName ( ) = "allow_forgery_protection=" and
112
+ hasBooleanValue ( result .getArgument ( 0 ) , verificationSetting )
115
113
}
116
114
117
115
/**
You can’t perform that action at this time.
0 commit comments