Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
a3d8fa16
Commit
a3d8fa16
authored
6 years ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2989243
by xjm: _update_equivalent_security_releases() should not diverge per branch
parent
4fdf7257
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/update/update.module
+54
-0
54 additions, 0 deletions
core/modules/update/update.module
with
54 additions
and
0 deletions
core/modules/update/update.module
+
54
−
0
View file @
a3d8fa16
...
...
@@ -404,9 +404,63 @@ function update_get_available($refresh = FALSE) {
$available
=
\Drupal
::
keyValueExpirable
(
'update_available_releases'
)
->
getAll
();
}
// Check for security releases that are covered under the same security
// advisories as the site's current release, and override the update status
// data so that those releases are not flagged as needed security updates.
// Any security releases beyond those specific releases will still be shown
// as required security updates.
// @todo This is a temporary fix to allow minor-version backports of security
// fixes to be shown as secure. It should not be included in the codebase of
// any release or branch other than such backports. Replace this with
// https://www.drupal.org/project/drupal/issues/2804155.
foreach
(
_update_equivalent_security_releases
()
as
$equivalent_release
)
{
if
(
!
empty
(
$available
[
'drupal'
][
'releases'
][
$equivalent_release
][
'terms'
][
'Release type'
]))
{
$security_release_key
=
array_search
(
'Security update'
,
$available
[
'drupal'
][
'releases'
][
$equivalent_release
][
'terms'
][
'Release type'
]);
if
(
$security_release_key
!==
FALSE
)
{
unset
(
$available
[
'drupal'
][
'releases'
][
$equivalent_release
][
'terms'
][
'Release type'
][
$security_release_key
]);
}
}
}
return
$available
;
}
/**
* Identifies equivalent security releases with a hardcoded list.
*
* Generally, only the latest minor version of Drupal 8 is supported. However,
* when security fixes are backported to an old branch, and the site owner
* updates to the release containing the backported fix, they should not
* see "Security update required!" again if the only other security releases
* are releases for the same advisories.
*
* @return string[]
* A list of security release numbers that are equivalent to this release
* (i.e. covered by the same advisory), for backported security fixes only.
*
* @todo This is a temporary fix to allow minor-version backports of security
* fixes to be shown as secure. Replace this with
* https://www.drupal.org/project/drupal/issues/2766491.
*/
function
_update_equivalent_security_releases
()
{
switch
(
\Drupal
::
VERSION
)
{
case
'8.3.8'
:
return
[
'8.4.5'
,
'8.5.0-rc1'
];
case
'8.3.9'
:
return
[
'8.4.6'
,
'8.5.1'
];
case
'8.4.5'
:
return
[
'8.5.0-rc1'
];
case
'8.4.6'
:
return
[
'8.5.1'
];
case
'8.4.7'
:
return
[
'8.5.2'
];
case
'8.4.8'
:
return
[
'8.5.3'
];
}
return
[];
}
/**
* Adds a task to the queue for fetching release history data for a project.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment