File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
ruby/ql/lib/codeql/ruby/frameworks/actioncontroller Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ module Filters {
104
104
105
105
StringlikeLiteralCfgNode getFilterArgument ( ) { result = this .getPositionalArgument ( _) }
106
106
107
+ string getFilterArgumentName ( ) {
108
+ result = this .getFilterArgument ( ) .getConstantValue ( ) .getStringlikeValue ( )
109
+ }
110
+
107
111
/**
108
112
* Gets the callable that implements the filter with name `name`.
109
113
* This currently only finds methods in the local class or superclass.
@@ -122,8 +126,8 @@ module Filters {
122
126
* end
123
127
* ```
124
128
*/
125
- Callable getFilterCallable ( string name ) {
126
- result .( MethodBase ) .getName ( ) = name and
129
+ Callable getAFilterCallable ( ) {
130
+ this . getFilterArgumentName ( ) = result .( MethodBase ) .getName ( ) and
127
131
result .getEnclosingModule ( ) .getModule ( ) =
128
132
this .getExpr ( ) .getEnclosingModule ( ) .getModule ( ) .getAnAncestor ( )
129
133
}
@@ -321,7 +325,9 @@ module Filters {
321
325
322
326
string getFilterName ( ) { result = this .getConstantValue ( ) .getStringlikeValue ( ) }
323
327
324
- Callable getFilterCallable ( ) { result = call .getFilterCallable ( this .getFilterName ( ) ) }
328
+ Callable getFilterCallable ( ) {
329
+ result = call .getAFilterCallable ( ) and result .( MethodBase ) .getName ( ) = this .getFilterName ( )
330
+ }
325
331
326
332
ActionControllerActionMethod getAnAction ( ) { result = call .getAnAction ( ) }
327
333
}
You can’t perform that action at this time.
0 commit comments