File tree Expand file tree Collapse file tree 5 files changed +87
-33
lines changed
app/code/Magento/Theme/view Expand file tree Collapse file tree 5 files changed +87
-33
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ var config = {
52
52
'mixins' : {
53
53
'jquery/jstree/jquery.jstree' : {
54
54
'mage/backend/jstree-mixin' : true
55
+ } ,
56
+ 'jquery' : {
57
+ 'jquery/patches/jquery' : true
55
58
}
56
59
} ,
57
60
'text' : {
@@ -61,9 +64,3 @@ var config = {
61
64
}
62
65
}
63
66
} ;
64
-
65
- require ( [ 'jquery' ] , function ( $ ) {
66
- 'use strict' ;
67
-
68
- $ . noConflict ( ) ;
69
- } ) ;
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ var config = {
44
44
mixins : {
45
45
'Magento_Theme/js/view/breadcrumbs' : {
46
46
'Magento_Theme/js/view/add-home-breadcrumb' : true
47
+ } ,
48
+ 'jquery/jquery-ui' : {
49
+ 'jquery/patches/jquery-ui' : true
47
50
}
48
51
}
49
52
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ define ( [
7
+ 'jquery'
8
+ ] , function ( $ ) {
9
+ 'use strict' ;
10
+
11
+ /**
12
+ * Patch for CVE-2016-7103 (XSS vulnerability).
13
+ * Can safely remove only when jQuery UI is upgraded to >= 1.12.x.
14
+ * https://www.cvedetails.com/cve/CVE-2016-7103/
15
+ */
16
+ function dialogPatch ( ) {
17
+ $ . widget ( 'ui.dialog' , $ . ui . dialog , {
18
+ /** @inheritdoc */
19
+ _createTitlebar : function ( ) {
20
+ this . options . closeText = $ ( '<a>' ) . text ( '' + this . options . closeText ) . html ( ) ;
21
+
22
+ this . _superApply ( ) ;
23
+ } ,
24
+
25
+ /** @inheritdoc */
26
+ _setOption : function ( key , value ) {
27
+ if ( key === 'closeText' ) {
28
+ value = $ ( '<a>' ) . text ( '' + value ) . html ( ) ;
29
+ }
30
+
31
+ this . _super ( key , value ) ;
32
+ }
33
+ } ) ;
34
+ }
35
+
36
+ return function ( ) {
37
+ var majorVersion = $ . ui . version . split ( '.' ) [ 0 ] ,
38
+ minorVersion = $ . ui . version . split ( '.' ) [ 1 ] ;
39
+
40
+ if ( majorVersion === 1 && minorVersion >= 12 || majorVersion >= 2 ) {
41
+ console . warn ( 'jQuery patch for CVE-2016-7103 is no longer necessary, and should be removed' ) ;
42
+ }
43
+
44
+ dialogPatch ( ) ;
45
+ } ;
46
+ } ) ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ define ( [ ] , function ( ) {
7
+ 'use strict' ;
8
+
9
+ /**
10
+ * Patch for CVE-2015-9251 (XSS vulnerability).
11
+ * Can safely remove only when jQuery UI is upgraded to >= 3.3.x.
12
+ * https://www.cvedetails.com/cve/CVE-2015-9251/
13
+ */
14
+ function ajaxResponsePatch ( jQuery ) {
15
+ jQuery . ajaxPrefilter ( function ( s ) {
16
+ if ( s . crossDomain ) {
17
+ s . contents . script = false ;
18
+ }
19
+ } ) ;
20
+ }
21
+
22
+ return function ( $ ) {
23
+ var majorVersion = $ . fn . jquery . split ( '.' ) [ 0 ] ;
24
+
25
+ $ . noConflict ( ) ;
26
+
27
+ if ( majorVersion >= 3 ) {
28
+ console . warn ( 'jQuery patch for CVE-2015-9251 is no longer necessary, and should be removed' ) ;
29
+ }
30
+
31
+ ajaxResponsePatch ( jQuery ) ;
32
+
33
+ return jQuery ;
34
+ } ;
35
+ } ) ;
Original file line number Diff line number Diff line change 200
200
}
201
201
} ) ;
202
202
203
- $ . widget ( 'ui.button' , $ . ui . button , {
204
- /**
205
- * @private
206
- */
207
- _create : function ( ) {
208
- this . _super ( ) ;
209
- // Decode HTML entities to prevent incorrect rendering of dialog button label
210
- this . options . label = this . options . label ?
211
- jQuery ( '<div/>' ) . html ( this . options . label ) . text ( ) : this . options . label ;
212
- //Reset button to make decoded label visible
213
- this . _resetButton ( ) ;
214
- }
215
- } ) ;
216
-
217
- $ . widget ( 'ui.dialog' , $ . ui . dialog , {
218
- /**
219
- * Prevent rendering of dialog title as escaped HTML
220
- */
221
- _title : function ( title ) {
222
- this . _super ( title ) ;
223
-
224
- if ( this . options . title ) {
225
- title . html ( this . options . title ) ;
226
- }
227
- }
228
- } ) ;
229
-
230
203
return $ . mage . translateInline ;
231
204
} ) ) ;
You can’t perform that action at this time.
0 commit comments