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 {
3535 }
3636 }
3737
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+
3849 /**
3950 * A call to a class method that adds or removes a filter from the callback chain.
4051 * This class exists to encapsulate common behavior between calls that
@@ -65,14 +76,7 @@ module Filters {
6576 not exists ( this .getOnlyArgument ( ) ) and
6677 forall ( string except | except = this .getExceptArgument ( ) | result .getName ( ) != except )
6778 ) 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 )
7680 }
7781
7882 private string getOnlyArgument ( ) {
You can’t perform that action at this time.
0 commit comments