diff --git a/core/modules/update/css/update.admin.theme.css b/core/modules/update/css/update.admin.theme.css index abf0a88..c3711f4 100644 --- a/core/modules/update/css/update.admin.theme.css +++ b/core/modules/update/css/update.admin.theme.css @@ -8,10 +8,12 @@ font-size: 110%; } .project-update__status { + text-align: right; /* LTR */ float: right; /* LTR */ font-size: 110%; } [dir="rtl"] .project-update__status { + text-align: left; float: left; } .project-update__status--not-supported { @@ -32,6 +34,9 @@ padding-left: 0; padding-right: 0.5em; } +.project-update__status-icon img { + vertical-align: top; +} .project-update__details { padding: 1em 1em 0.25em 1em; } diff --git a/core/modules/update/images/shield-icon.svg b/core/modules/update/images/shield-icon.svg new file mode 100644 index 0000000..9a7c56d --- /dev/null +++ b/core/modules/update/images/shield-icon.svg @@ -0,0 +1,35 @@ + + diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php index 81f7117..7434c3c 100644 --- a/core/modules/update/src/Tests/UpdateContribTest.php +++ b/core/modules/update/src/Tests/UpdateContribTest.php @@ -84,6 +84,8 @@ public function testUpdateContribBasic() { $this->assertRaw('
' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '
'; + $icon = [ + '#theme' => 'image', + '#width' => 18, + '#height' => 18, + '#uri' => 'core/modules/update/images/shield-icon.svg', + '#alt' => t('Shield'), + '#title' => t('Shield'), + ]; + $output = '' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '
'; + $output .= '' . t('Modules and themes with a shield icon @icon are covered by the Drupal Security Team’s advisory policy. Vulnerabilities reported to the Security Team will be responsibly disclosed.', ['@icon' => \Drupal::service('renderer')->render($icon)]) . '
'; + return $output; case 'system.modules_list': if (_update_manager_access()) { diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 7b14a05..81a3823 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -260,6 +260,35 @@ function template_preprocess_update_project_status(&$variables) { $variables['status']['attributes'] = new Attribute(); $variables['status']['reason'] = (isset($project['reason'])) ? $project['reason'] : NULL; + if (isset($project['security'])) { + $variables['status']['security'] = $project['security']; + } + if (!empty($project['security_covered'])) { + // The update server confirms this release is covered for security + // announcements. + $variables['status']['security_icon'] = [ + '#theme' => 'image', + '#width' => 18, + '#height' => 18, + '#uri' => 'core/modules/update/images/shield-icon.svg', + '#alt' => t('Shield'), + '#title' => t('Shield'), + ]; + } + elseif (!empty($project['security'])) { + // The update server confirms this release is NOT covered for security + // announcements. + $variables['status']['security_icon'] = [ + '#theme' => 'image', + '#width' => 18, + '#height' => 18, + '#uri' => 'core/misc/icons/e29700/warning.svg', + '#alt' => t('Warning'), + '#title' => t('Warning'), + ]; + drupal_set_message(t('Your site uses modules and/or themes that are not subject to the Drupal Security Team’s advisory policy. When vulnerabilities are discovered, they may be disclosed publicly without a fix, and will not have security announcements.'), 'warning'); + } + switch ($project['status']) { case UPDATE_CURRENT: $uri = 'core/misc/icons/73b355/check.svg'; diff --git a/core/themes/stable/css/update/update.admin.theme.css b/core/themes/stable/css/update/update.admin.theme.css index abf0a88..c3711f4 100644 --- a/core/themes/stable/css/update/update.admin.theme.css +++ b/core/themes/stable/css/update/update.admin.theme.css @@ -8,10 +8,12 @@ font-size: 110%; } .project-update__status { + text-align: right; /* LTR */ float: right; /* LTR */ font-size: 110%; } [dir="rtl"] .project-update__status { + text-align: left; float: left; } .project-update__status--not-supported { @@ -32,6 +34,9 @@ padding-left: 0; padding-right: 0.5em; } +.project-update__status-icon img { + vertical-align: top; +} .project-update__details { padding: 1em 1em 0.25em 1em; } diff --git a/core/themes/stable/templates/admin/update-project-status.html.twig b/core/themes/stable/templates/admin/update-project-status.html.twig index 5a6d2ec..8a7b775 100644 --- a/core/themes/stable/templates/admin/update-project-status.html.twig +++ b/core/themes/stable/templates/admin/update-project-status.html.twig @@ -43,9 +43,15 @@ +