@@ -67,9 +67,9 @@ abstract class DjangoRequestSource extends HttpRequestTaintSource {
6767private class DjangoFunctionBasedViewRequestArgument extends DjangoRequestSource {
6868
6969 DjangoFunctionBasedViewRequestArgument ( ) {
70- exists ( FunctionObject view |
70+ exists ( FunctionValue view |
7171 url_dispatch ( _, _, view ) and
72- this = view .getFunction ( ) .getArg ( 0 ) .asName ( ) .getAFlowNode ( )
72+ this = view .getScope ( ) .getArg ( 0 ) .asName ( ) .getAFlowNode ( )
7373 )
7474 }
7575
@@ -79,23 +79,24 @@ private class DjangoFunctionBasedViewRequestArgument extends DjangoRequestSource
7979 * https://docs.djangoproject.com/en/1.11/topics/class-based-views/
8080 *
8181 */
82- private class DjangoView extends ClassObject {
82+ private class DjangoView extends ClassValue {
8383
8484 DjangoView ( ) {
85- ModuleObject :: named ( "django.views.generic" ) . attr ( " View") = this .getAnImproperSuperType ( )
85+ Value :: named ( "django.views.generic. View" ) = this .getASuperType ( )
8686 }
87+
8788}
8889
89- private FunctionObject djangoViewHttpMethod ( ) {
90+ private FunctionValue djangoViewHttpMethod ( ) {
9091 exists ( DjangoView view |
91- view .lookupAttribute ( httpVerbLower ( ) ) = result
92+ view .attr ( httpVerbLower ( ) ) = result
9293 )
9394}
9495
9596class DjangoClassBasedViewRequestArgument extends DjangoRequestSource {
9697
9798 DjangoClassBasedViewRequestArgument ( ) {
98- this = djangoViewHttpMethod ( ) .getFunction ( ) .getArg ( 1 ) .asName ( ) .getAFlowNode ( )
99+ this = djangoViewHttpMethod ( ) .getScope ( ) .getArg ( 1 ) .asName ( ) .getAFlowNode ( )
99100 }
100101
101102}
@@ -107,11 +108,11 @@ class DjangoClassBasedViewRequestArgument extends DjangoRequestSource {
107108
108109
109110/* Function based views */
110- predicate url_dispatch ( CallNode call , ControlFlowNode regex , FunctionObject view ) {
111- exists ( FunctionObject url |
112- ModuleObject :: named ( "django.conf.urls" ) . attr ( " url") = url and
111+ predicate url_dispatch ( CallNode call , ControlFlowNode regex , FunctionValue view ) {
112+ exists ( FunctionValue url |
113+ Value :: named ( "django.conf.urls. url" ) = url and
113114 url .getArgumentForCall ( call , 0 ) = regex and
114- url .getArgumentForCall ( call , 1 ) .refersTo ( view )
115+ url .getArgumentForCall ( call , 1 ) .pointsTo ( view )
115116 )
116117}
117118
@@ -130,7 +131,7 @@ class UrlRouting extends CallNode {
130131 url_dispatch ( this , _, _)
131132 }
132133
133- FunctionObject getViewFunction ( ) {
134+ FunctionValue getViewFunction ( ) {
134135 url_dispatch ( this , _, result )
135136 }
136137
@@ -149,7 +150,7 @@ class HttpRequestParameter extends HttpRequestTaintSource {
149150 HttpRequestParameter ( ) {
150151 exists ( UrlRouting url |
151152 this .( ControlFlowNode ) .getNode ( ) =
152- url .getViewFunction ( ) .getFunction ( ) .getArgByName ( url .getNamedArgument ( ) )
153+ url .getViewFunction ( ) .getScope ( ) .getArgByName ( url .getNamedArgument ( ) )
153154 )
154155 }
155156
0 commit comments