File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
ruby/ql/lib/codeql/ruby/frameworks/actioncontroller Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,17 @@ module Filters {
35
35
}
36
36
}
37
37
38
+ bindingset [ call]
39
+ pragma [ inline_late]
40
+ private ActionControllerActionMethod getADescendentAction ( MethodCallCfgNode call ) {
41
+ result = call .getExpr ( ) .getEnclosingModule ( ) .getAMethod ( )
42
+ or
43
+ exists ( ModuleBase m |
44
+ m .getModule ( ) = call .getExpr ( ) .getEnclosingModule ( ) .getModule ( ) .getAnImmediateDescendent + ( ) and
45
+ result = m .getAMethod ( )
46
+ )
47
+ }
48
+
38
49
/**
39
50
* A call to a class method that adds or removes a filter from the callback chain.
40
51
* This class exists to encapsulate common behavior between calls that
@@ -65,14 +76,7 @@ module Filters {
65
76
not exists ( this .getOnlyArgument ( ) ) and
66
77
forall ( string except | except = this .getExceptArgument ( ) | result .getName ( ) != except )
67
78
) and
68
- (
69
- result = this .getExpr ( ) .getEnclosingModule ( ) .getAMethod ( )
70
- or
71
- exists ( ModuleBase m |
72
- m .getModule ( ) = this .getExpr ( ) .getEnclosingModule ( ) .getModule ( ) .getADescendent ( ) and
73
- result = m .getAMethod ( )
74
- )
75
- )
79
+ result = getADescendentAction ( this )
76
80
}
77
81
78
82
private string getOnlyArgument ( ) {
You can’t perform that action at this time.
0 commit comments