Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
e660a7a8
Commit
e660a7a8
authored
Apr 17, 2019
by
xjm
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SA-
CORE-2019
-006 by effulgentsia, lauriii, larowlan, xjm, greggles, drumm, dtv_rb, samuel.mortenson
parent
0eaeadc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
0 deletions
+121
-0
core/assets/vendor/jquery/jquery-extend-3.4.0.js
core/assets/vendor/jquery/jquery-extend-3.4.0.js
+111
-0
core/core.libraries.yml
core/core.libraries.yml
+3
-0
core/modules/system/system.post_update.php
core/modules/system/system.post_update.php
+7
-0
No files found.
core/assets/vendor/jquery/jquery-extend-3.4.0.js
0 → 100644
View file @
e660a7a8
/**
* For jQuery versions less than 3.4.0, this replaces the jQuery.extend
* function with the one from jQuery 3.4.0, slightly modified (documented
* below) to be compatible with older jQuery versions.
*
* This provides the Object.prototype pollution vulnerability fix to Drupal
* installations running older jQuery versions, including the version (3.2.1)
* shipped with Drupal core.
*
* @see https://github.com/jquery/jquery/pull/4333
*/
(
function
(
jQuery
)
{
// Do not override jQuery.extend() if the jQuery version is already >=3.4.0.
var
versionParts
=
jQuery
.
fn
.
jquery
.
split
(
'
.
'
);
var
majorVersion
=
parseInt
(
versionParts
[
0
]);
var
minorVersion
=
parseInt
(
versionParts
[
1
]);
var
patchVersion
=
parseInt
(
versionParts
[
2
]);
var
isPreReleaseVersion
=
(
patchVersion
.
toString
()
!==
versionParts
[
2
]);
if
(
(
majorVersion
>
3
)
||
(
majorVersion
===
3
&&
minorVersion
>
4
)
||
(
majorVersion
===
3
&&
minorVersion
===
4
&&
patchVersion
>
0
)
||
(
majorVersion
===
3
&&
minorVersion
===
4
&&
patchVersion
===
0
&&
!
isPreReleaseVersion
)
)
{
return
;
}
/**
* This is almost verbatim copied from jQuery 3.4.0.
*
* Only one minor change has been made:
* - The call to isFunction() is changed to jQuery.isFunction().
*
* The above change ensures compatibility with older jQuery versions,
* including 3.2.1 which is shipped with Drupal core.
*/
jQuery
.
extend
=
jQuery
.
fn
.
extend
=
function
()
{
var
options
,
name
,
src
,
copy
,
copyIsArray
,
clone
,
target
=
arguments
[
0
]
||
{},
i
=
1
,
length
=
arguments
.
length
,
deep
=
false
;
// Handle a deep copy situation
if
(
typeof
target
===
"
boolean
"
)
{
deep
=
target
;
// Skip the boolean and the target
target
=
arguments
[
i
]
||
{};
i
++
;
}
// Handle case when target is a string or something (possible in deep copy)
if
(
typeof
target
!==
"
object
"
&&
!
jQuery
.
isFunction
(
target
)
)
{
target
=
{};
}
// Extend jQuery itself if only one argument is passed
if
(
i
===
length
)
{
target
=
this
;
i
--
;
}
for
(
;
i
<
length
;
i
++
)
{
// Only deal with non-null/undefined values
if
(
(
options
=
arguments
[
i
]
)
!=
null
)
{
// Extend the base object
for
(
name
in
options
)
{
copy
=
options
[
name
];
// Prevent Object.prototype pollution
// Prevent never-ending loop
if
(
name
===
"
__proto__
"
||
target
===
copy
)
{
continue
;
}
// Recurse if we're merging plain objects or arrays
if
(
deep
&&
copy
&&
(
jQuery
.
isPlainObject
(
copy
)
||
(
copyIsArray
=
Array
.
isArray
(
copy
)
)
)
)
{
src
=
target
[
name
];
// Ensure proper type for the source value
if
(
copyIsArray
&&
!
Array
.
isArray
(
src
)
)
{
clone
=
[];
}
else
if
(
!
copyIsArray
&&
!
jQuery
.
isPlainObject
(
src
)
)
{
clone
=
{};
}
else
{
clone
=
src
;
}
copyIsArray
=
false
;
// Never move original objects, clone them
target
[
name
]
=
jQuery
.
extend
(
deep
,
clone
,
copy
);
// Don't bring in undefined values
}
else
if
(
copy
!==
undefined
)
{
target
[
name
]
=
copy
;
}
}
}
}
// Return the modified object
return
target
;
};
})(
jQuery
);
core/core.libraries.yml
View file @
e660a7a8
...
...
@@ -348,6 +348,9 @@ jquery:
gpl-compatible
:
true
js
:
assets/vendor/jquery/jquery.min.js
:
{
minified
:
true
,
weight
:
-20
}
# This includes a security fix, so assign a weight that makes this load as
# soon after jquery.min.js is loaded as possible.
assets/vendor/jquery/jquery-extend-3.4.0.js
:
{
weight
:
-19
}
jquery.cookie
:
remote
:
https://github.com/carhartl/jquery-cookie
...
...
core/modules/system/system.post_update.php
View file @
e660a7a8
...
...
@@ -90,6 +90,13 @@ function system_post_update_field_formatter_entity_schema() {
// Empty post-update hook.
}
/**
* Clear the library cache and ensure aggregate files are regenerated.
*/
function
system_post_update_fix_jquery_extend
()
{
// Empty post-update hook.
}
/**
* Change plugin IDs of actions.
*/
...
...
xjm
@xjm
mentioned in commit
235faf88
·
Apr 17, 2019
mentioned in commit
235faf88
mentioned in commit 235faf8867432f45d4f8cffcc6e370de22ccae1b
Toggle commit list
xjm
@xjm
mentioned in commit
b852d34d
·
Apr 17, 2019
mentioned in commit
b852d34d
mentioned in commit b852d34d6704991172ef310e9381c65603c4a8b9
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment