@@ -18,7 +18,7 @@ module UnsafeJQueryPlugin {
18
18
/**
19
19
* Gets the plugin that this source is used in.
20
20
*/
21
- abstract JQueryPluginMethod getPlugin ( ) ;
21
+ abstract JQuery :: JQueryPluginMethod getPlugin ( ) ;
22
22
}
23
23
24
24
/**
@@ -49,26 +49,6 @@ module UnsafeJQueryPlugin {
49
49
}
50
50
}
51
51
52
- /**
53
- * Gets a node that is registered as a jQuery plugin method at `def`.
54
- */
55
- private DataFlow:: SourceNode getAJQueryPluginMethod (
56
- DataFlow:: TypeBackTracker t , DataFlow:: Node def
57
- ) {
58
- t .start ( ) and
59
- jQueryPluginDefinition ( _, def ) and
60
- result .flowsTo ( def )
61
- or
62
- exists ( DataFlow:: TypeBackTracker t2 | result = getAJQueryPluginMethod ( t2 , def ) .backtrack ( t2 , t ) )
63
- }
64
-
65
- /**
66
- * Gets a function that is registered as a jQuery plugin method at `def`.
67
- */
68
- private DataFlow:: FunctionNode getAJQueryPluginMethod ( DataFlow:: Node def ) {
69
- result = getAJQueryPluginMethod ( DataFlow:: TypeBackTracker:: end ( ) , def )
70
- }
71
-
72
52
/**
73
53
* Gets an operand to `extend`.
74
54
*/
@@ -86,29 +66,10 @@ module UnsafeJQueryPlugin {
86
66
result = getAnExtendOperand ( DataFlow:: TypeBackTracker:: end ( ) , extend )
87
67
}
88
68
89
- /**
90
- * A function that is registered as a jQuery plugin method.
91
- */
92
- class JQueryPluginMethod extends DataFlow:: FunctionNode {
93
- string pluginName ;
94
-
95
- JQueryPluginMethod ( ) {
96
- exists ( DataFlow:: Node def |
97
- jQueryPluginDefinition ( pluginName , def ) and
98
- this = getAJQueryPluginMethod ( def )
99
- )
100
- }
101
-
102
- /**
103
- * Gets the name of this plugin.
104
- */
105
- string getPluginName ( ) { result = pluginName }
106
- }
107
-
108
69
/**
109
70
* Holds if `plugin` has a default option defined at `def`.
110
71
*/
111
- private predicate hasDefaultOption ( JQueryPluginMethod plugin , DataFlow:: PropWrite def ) {
72
+ private predicate hasDefaultOption ( JQuery :: JQueryPluginMethod plugin , DataFlow:: PropWrite def ) {
112
73
exists ( ExtendCall extend , JQueryPluginOptions options , DataFlow:: SourceNode default |
113
74
options .getPlugin ( ) = plugin and
114
75
options = getAnExtendOperand ( extend ) and
@@ -121,7 +82,7 @@ module UnsafeJQueryPlugin {
121
82
* The client-provided options object for a jQuery plugin.
122
83
*/
123
84
class JQueryPluginOptions extends DataFlow:: ParameterNode {
124
- JQueryPluginMethod method ;
85
+ JQuery :: JQueryPluginMethod method ;
125
86
126
87
JQueryPluginOptions ( ) {
127
88
exists ( string optionsPattern |
@@ -142,7 +103,7 @@ module UnsafeJQueryPlugin {
142
103
/**
143
104
* Gets the plugin method that these options are used in.
144
105
*/
145
- JQueryPluginMethod getPlugin ( ) { result = method }
106
+ JQuery :: JQueryPluginMethod getPlugin ( ) { result = method }
146
107
}
147
108
148
109
/**
@@ -201,7 +162,9 @@ module UnsafeJQueryPlugin {
201
162
* The client-provided options object for a jQuery plugin, considered as a source for unsafe jQuery plugins.
202
163
*/
203
164
class JQueryPluginOptionsAsSource extends Source , JQueryPluginOptions {
204
- override JQueryPluginMethod getPlugin ( ) { result = JQueryPluginOptions .super .getPlugin ( ) }
165
+ override JQuery:: JQueryPluginMethod getPlugin ( ) {
166
+ result = JQueryPluginOptions .super .getPlugin ( )
167
+ }
205
168
}
206
169
207
170
/**
@@ -223,7 +186,7 @@ module UnsafeJQueryPlugin {
223
186
/**
224
187
* Holds if `plugin` likely expects `sink` to be treated as a HTML fragment.
225
188
*/
226
- predicate isLikelyIntentionalHtmlSink ( JQueryPluginMethod plugin , Sink sink ) {
189
+ predicate isLikelyIntentionalHtmlSink ( JQuery :: JQueryPluginMethod plugin , Sink sink ) {
227
190
exists ( DataFlow:: PropWrite defaultDef , string default , DataFlow:: PropRead finalRead |
228
191
hasDefaultOption ( plugin , defaultDef ) and
229
192
defaultDef .getPropertyName ( ) = finalRead .getPropertyName ( ) and
0 commit comments