Skip to content

Commit a6dafff

Browse files
committed
🔒️ fix CVE-2020-11022
1 parent f08ca81 commit a6dafff

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/core.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -953,13 +953,6 @@ jQuery.extend({
953953

954954
// Convert html string into DOM nodes
955955
if ( typeof elem == "string" ) {
956-
// Fix "XHTML"-style tags in all browsers
957-
elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
958-
return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
959-
all :
960-
front + "></" + tag + ">";
961-
});
962-
963956
// Trim whitespace, otherwise indexOf won't work as expected
964957
var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");
965958

test/unit/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test("$()", function() {
3939
equals( code.length, 1, "Correct number of elements generated for code" );
4040
var img = $("<img/>");
4141
equals( img.length, 1, "Correct number of elements generated for img" );
42-
var div = $("<div/><hr/><code/><b/>");
42+
var div = $("<div></div><hr><code></code><b></b>");
4343
equals( div.length, 4, "Correct number of elements generated for div hr code b" );
4444

4545
// can actually yield more than one, when iframes are included, the window is an array as well

0 commit comments

Comments
 (0)