Skip to content

Commit e5a5d49

Browse files
committed
🔒️ fix CVE-2020-11023
1 parent a92926c commit e5a5d49

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

jquery.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright 2011, The Dojo Foundation
1212
* Released under the MIT, BSD, and GPL Licenses.
1313
*
14-
* Date: Mon Dec 11 15:41:51 2023 -0600
14+
* Date: Mon Dec 11 16:03:03 2023 -0600
1515
*/
1616
(function( window, undefined ) {
1717

@@ -1403,6 +1403,12 @@ jQuery.support = (function() {
14031403
}
14041404
}
14051405

1406+
// Support: IE <=9 only
1407+
// IE <=9 replaces <option> tags with their contents when inserted outside of
1408+
// the select element.
1409+
div.innerHTML = "<option></option>";
1410+
support.option = !!div.lastChild;
1411+
14061412
// Null connected elements to avoid leaks in IE
14071413
testElement = fragment = select = opt = body = marginDiv = div = input = null;
14081414

@@ -5540,7 +5546,6 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
55405546
rscriptType = /\/(java|ecma)script/i,
55415547
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
55425548
wrapMap = {
5543-
option: [ 1, "<select multiple='multiple'>", "</select>" ],
55445549
legend: [ 1, "<fieldset>", "</fieldset>" ],
55455550
thead: [ 1, "<table>", "</table>" ],
55465551
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
@@ -5550,10 +5555,14 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
55505555
_default: [ 0, "", "" ]
55515556
};
55525557

5553-
wrapMap.optgroup = wrapMap.option;
55545558
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
55555559
wrapMap.th = wrapMap.td;
55565560

5561+
// Support: IE <=9 only
5562+
if ( !support.option ) {
5563+
wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
5564+
}
5565+
55575566
// IE can't serialize <link> and <script> tags normally
55585567
if ( !jQuery.support.htmlSerialize ) {
55595568
wrapMap._default = [ 1, "div<div>", "</div>" ];

src/manipulation.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
1111
rscriptType = /\/(java|ecma)script/i,
1212
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
1313
wrapMap = {
14-
option: [ 1, "<select multiple='multiple'>", "</select>" ],
1514
legend: [ 1, "<fieldset>", "</fieldset>" ],
1615
thead: [ 1, "<table>", "</table>" ],
1716
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
@@ -21,10 +20,14 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
2120
_default: [ 0, "", "" ]
2221
};
2322

24-
wrapMap.optgroup = wrapMap.option;
2523
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
2624
wrapMap.th = wrapMap.td;
2725

26+
// Support: IE <=9 only
27+
if ( !support.option ) {
28+
wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
29+
}
30+
2831
// IE can't serialize <link> and <script> tags normally
2932
if ( !jQuery.support.htmlSerialize ) {
3033
wrapMap._default = [ 1, "div<div>", "</div>" ];

src/support.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ jQuery.support = (function() {
246246
}
247247
}
248248

249+
// Support: IE <=9 only
250+
// IE <=9 replaces <option> tags with their contents when inserted outside of
251+
// the select element.
252+
div.innerHTML = "<option></option>";
253+
support.option = !!div.lastChild;
254+
249255
// Null connected elements to avoid leaks in IE
250256
testElement = fragment = select = opt = body = marginDiv = div = input = null;
251257

0 commit comments

Comments
 (0)