@@ -9,15 +9,15 @@ private import codeql.ruby.Concepts
99/**
1010 * Provides templating for embedding Ruby code into text files, allowing dynamic content generation in web applications.
1111 */
12- module ERB {
12+ module Erb {
1313 /**
1414 * Flow summary for `ERB.new`. This method wraps a template string, compiling it.
1515 */
1616 private class TemplateSummary extends SummarizedCallable {
1717 TemplateSummary ( ) { this = "ERB.new" }
1818
1919 override MethodCall getACall ( ) {
20- result = API :: getTopLevelMember ( "ERB" ) . getAMethodCall ( "new" ) .asExpr ( ) .getExpr ( )
20+ result = any ( ErbTemplateNewCall c ) .asExpr ( ) .getExpr ( )
2121 }
2222
2323 override predicate propagatesFlowExt ( string input , string output , boolean preservesValue ) {
@@ -26,18 +26,18 @@ module ERB {
2626 }
2727
2828 /** A call to `ERB.new`, considered as a template construction. */
29- private class ERBTemplateNewCall extends TemplateConstruction:: Range , DataFlow:: CallNode {
30- ERBTemplateNewCall ( ) { this = API:: getTopLevelMember ( "ERB" ) .getAMethodCall ( "new" ) }
29+ private class ErbTemplateNewCall extends TemplateConstruction:: Range , DataFlow:: CallNode {
30+ ERBTemplateNewCall ( ) { this = API:: getTopLevelMember ( "ERB" ) .getAnInstantiation ( ) }
3131
3232 override DataFlow:: Node getTemplate ( ) { result = this .getArgument ( 0 ) }
3333 }
3434
3535 /** A call to `ERB.new(foo).result(binding)`, considered as a template rendering. */
36- private class ERBTemplateRendering extends TemplateRendering:: Range , DataFlow:: CallNode {
37- DataFlow:: Node template ;
36+ private class ErbTemplateRendering extends TemplateRendering:: Range , DataFlow:: CallNode {
37+ private DataFlow:: Node template ;
3838
39- ERBTemplateRendering ( ) {
40- exists ( ERBTemplateNewCall templateConstruction |
39+ ErbTemplateRendering ( ) {
40+ exists ( ErbTemplateNewCall templateConstruction |
4141 this = templateConstruction .getAMethodCall ( "result" ) and
4242 template = templateConstruction .getTemplate ( )
4343 )
0 commit comments