diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 948e6f4..9092e35 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -134,28 +134,27 @@ function system_requirements($phase) { } // Test PHP version and show link to phpinfo() if it's available - $phpversion = $phpversion_label = phpversion(); + $phpversion = phpversion(); + $requirements['php'] = [ + 'title' => t('PHP'), + 'value' => $phpversion, + ]; if (function_exists('phpinfo')) { - // $phpversion is safe and output of l() is safe, so this value is safe. - if ($phase === 'runtime') { - $phpversion_label = SafeMarkup::set($phpversion . ' (' . \Drupal::l(t('more information'), new Url('system.php')) . ')'); - } - $requirements['php'] = array( - 'title' => t('PHP'), - 'value' => $phpversion_label, - ); + $requirements['php']['description'][] = [ + '#markup' => t('For more information, view the phpinfo', ['@php-info', '/admin/reports/status/php']), + ]; } else { - $requirements['php'] = array( - 'title' => t('PHP'), - 'value' => $phpversion_label, - 'description' => t('The phpinfo() function has been disabled for security reasons. To see your server\'s phpinfo() information, change your PHP settings or contact your server administrator. For more information, Enabling and disabling phpinfo() handbook page.', array('@phpinfo' => 'https://www.drupal.org/node/243993')), - 'severity' => REQUIREMENT_INFO, - ); + $requirements['php']['description'][] = [ + '#markup' => t('The phpinfo() function has been disabled for security reasons. To see your server\'s phpinfo() information, change your PHP settings or contact your server administrator. For more information, Enabling and disabling phpinfo() handbook page.', ['@phpinfo' => 'https://www.drupal.org/node/243993']), + ]; + $requirements['php']['severity'] = REQUIREMENT_INFO; } if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) < 0) { - $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); + $requirements['php']['description'][] = [ + '#markup' => t('Your PHP installation is too old. Drupal requires at least PHP %version.', ['%version' => DRUPAL_MINIMUM_PHP]), + ]; $requirements['php']['severity'] = REQUIREMENT_ERROR; // If PHP is old, it's not safe to continue with the requirements check. return $requirements; @@ -164,12 +163,11 @@ function system_requirements($phase) { // Suggest to update to at least 5.5.21 or 5.6.5 for disabling multiple // statements. if (($phase === 'install' || \Drupal::database()->driver() === 'mysql') && !SystemRequirements::phpVersionWithPdoDisallowMultipleStatements($phpversion)) { - $requirements['php'] = array( - 'title' => t('PHP (multiple statement disabling)'), - 'value' => $phpversion_label, - 'description' => t('PHP versions higher than 5.6.5 or 5.5.21 provide built-in SQL injection protection for mysql databases. It is recommended to update.'), - 'severity' => REQUIREMENT_INFO, - ); + $requirements['php']['title'] = t('PHP (multiple statement disabling)'); + $requirements['php']['description'][] = [ + '#markup' => t('PHP versions higher than 5.6.5 or 5.5.21 provide built-in SQL injection protection for mysql databases. It is recommended to update.'), + ]; + $requirements['php']['severity'] = REQUIREMENT_INFO; } // Test for PHP extensions. @@ -415,8 +413,6 @@ function system_requirements($phase) { $threshold_warning = $cron_config->get('threshold.requirements_warning'); // Cron error threshold defaults to two weeks. $threshold_error = $cron_config->get('threshold.requirements_error'); - // Cron configuration help text. - $help = t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'https://www.drupal.org/cron')); // Determine when cron last ran. $cron_last = \Drupal::state()->get('system.cron_last'); @@ -435,24 +431,25 @@ function system_requirements($phase) { // Set summary and description based on values determined above. $summary = t('Last run !time ago', array('!time' => \Drupal::service('date.formatter')->formatTimeDiffSince($cron_last))); - $description = ''; - if ($severity != REQUIREMENT_INFO) { - $description = t('Cron has not run recently.') . ' ' . $help; - } - - $description .= ' ' . t('You can run cron manually.', array('@cron' => \Drupal::url('system.run_cron'))); - $description .= '
' . t('To run cron from outside the site, go to !cron', array('!cron' => \Drupal::url('system.cron', array('key' => \Drupal::state()->get('system.cron_key'), array('absolute' => TRUE))))); $requirements['cron'] = array( 'title' => t('Cron maintenance tasks'), 'severity' => $severity, 'value' => $summary, - // @todo This string is concatenated from t() calls, safe drupal_render() - // output, whitespace, and
tags, so is safe. However, as a best - // practice, we should not use SafeMarkup::set() around a variable. Fix - // in: https://www.drupal.org/node/2296929. - 'description' => SafeMarkup::set($description), ); + if ($severity != REQUIREMENT_INFO) { + $requirements['cron']['description'][] = ['#markup' => t('Cron has not run recently.')]; + $requirements['cron']['description'][] = [ + '#prefix' => ' ', + '#markup' => t('For more information, see the online handbook entry for configuring cron jobs.', ['@cron-handbook' => 'https://www.drupal.org/cron']), + '#suffix' => ' ', + ]; + } + $requirements['cron']['description'][] = ['#markup' => t('You can run cron manually.', ['@cron' => \Drupal::url('system.run_cron')])]; + $requirements['cron']['description'][] = [ + '#prefix' => '
', + '#markup' => t('To run cron from outside the site, go to @cron', ['@cron' => \Drupal::url('system.cron', ['key' => \Drupal::state()->get('system.cron_key'), ['absolute' => TRUE]])]), + ]; } if ($phase != 'install') { $filesystem_config = \Drupal::config('system.file');