Skip to content

Commit

Permalink
[TASK] Reflect patched jQuery state
Browse files Browse the repository at this point in the history
Documents the fact that bundled jQuery v3.4.1 actually has been patched
to reflect security changes for jQuery v3.5.1 - but besides that still
behaves like v3.4.1 in terms of backward compatibility.

Resolves: #94337
Releases: 10.4, 9.5
Change-Id: I00395f9307d16ee5d740a975017242587546f516
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69488
Tested-by: core-ci <typo3@b13.com>
Tested-by: Simon Gilli <typo3@gilbertsoft.org>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Simon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
andreaskienast committed Jul 9, 2021
1 parent 2301a35 commit 9fa8fad
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 20 deletions.
63 changes: 45 additions & 18 deletions Build/patches/jquery+3.4.1.patch
@@ -1,36 +1,63 @@
diff --git a/node_modules/jquery/dist/jquery.js b/node_modules/jquery/dist/jquery.js
index 773ad95..ef1eb73 100644
index 773ad95..e5d2ccf 100644
--- a/node_modules/jquery/dist/jquery.js
+++ b/node_modules/jquery/dist/jquery.js
@@ -4722,9 +4722,6 @@
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v3.4.1
+ * jQuery JavaScript Library v3.4.1+security1
* https://jquery.com/
*
* Includes Sizzle.js
@@ -10,6 +10,10 @@
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
+ *
+ * + security1 patch: CVE-2020-11022 & CVE-2020-11023
+ * - https://github.com/DanielRuf/snyk-js-jquery-565129
+ * - behaves like jQuery v3.5.1
*/
( function( global, factory ) {

@@ -142,7 +146,7 @@ function toType( obj ) {


var
- version = "3.4.1",
+ version = "3.4.1+security1",

// Define a local copy of jQuery
jQuery = function( selector, context ) {
@@ -4722,9 +4726,6 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
// We have to close these tags to support XHTML (#13200)
var wrapMap = {

- // Support: IE <=9 only
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
-
// XHTML parsers do not magically insert elements in the
// same way that tag soup parsers do. So we cannot shorten
// this by omitting <tbody> or other required elements.
@@ -4736,12 +4733,14 @@
@@ -4736,12 +4737,14 @@ var wrapMap = {
_default: [ 0, "", "" ]
};

-// Support: IE <=9 only
-wrapMap.optgroup = wrapMap.option;
-
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;

+// Support: IE <=9 only
+if ( !support.option ) {
+ wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
+}
+

function getAll( context, tag ) {

@@ -4897,6 +4896,12 @@
@@ -4897,6 +4900,12 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
// Make sure textarea (and checkbox) defaultValue is properly cloned
div.innerHTML = "<textarea>x</textarea>";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
Expand All @@ -41,28 +68,28 @@ index 773ad95..ef1eb73 100644
+ div.innerHTML = "<option></option>";
+ support.option = !!div.lastChild;
} )();


@@ -5771,11 +5771,6 @@ jQuery.fn.extend( {

@@ -5771,11 +5780,6 @@ jQuery.fn.extend( {
var

- /* eslint-disable max-len */
-
- // See https://github.com/eslint/eslint/issues/3229
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
-
/* eslint-enable */

// Support: IE <=10 - 11, Edge 12 - 13 only
@@ -5976,7 +5971,7 @@ function remove( elem, selector, keepData ) {

@@ -5976,7 +5980,7 @@ function remove( elem, selector, keepData ) {
jQuery.extend( {
htmlPrefilter: function( html ) {
- return html.replace( rxhtmlTag, "<$1></$2>" );
+ return html;
},

clone: function( elem, dataAndEvents, deepDataAndEvents ) {
diff --git a/node_modules/jquery/dist/jquery.min.js b/node_modules/jquery/dist/jquery.min.js
index a1c07fd..aebe828 100644
Expand Down
@@ -1,5 +1,5 @@
/*!
* jQuery JavaScript Library v3.4.1
* jQuery JavaScript Library v3.4.1+security1
* https://jquery.com/
*
* Includes Sizzle.js
Expand All @@ -10,6 +10,10 @@
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
*
* + security1 patch: CVE-2020-11022 & CVE-2020-11023
* - https://github.com/DanielRuf/snyk-js-jquery-565129
* - behaves like jQuery v3.5.1
*/
( function( global, factory ) {

Expand Down Expand Up @@ -142,7 +146,7 @@ function toType( obj ) {


var
version = "3.4.1",
version = "3.4.1+security1",

// Define a local copy of jQuery
jQuery = function( selector, context ) {
Expand Down

0 comments on commit 9fa8fad

Please sign in to comment.