From 400fa96fc6e61c7ada26827e49453bd7a1fb0189 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 5 Oct 2009 04:34:04 +0000 Subject: #224756 by christefano and lambic: Make phpinfo() link more obvious. --- modules/system/system.install | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/system/system.install b/modules/system/system.install index aeedcf972..77ef11498 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -54,12 +54,24 @@ function system_requirements($phase) { 'value' => $software, ); - // Test PHP version - $requirements['php'] = array( - 'title' => $t('PHP'), - 'value' => ($phase == 'runtime') ? l(phpversion(), 'admin/reports/status/php') : phpversion(), - ); - if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) { + // Test PHP version and show link to phpinfo() if it's available + $phpversion = phpversion(); + if (function_exists('phpinfo')) { + $requirements['php'] = array( + 'title' => $t('PHP'), + 'value' => ($phase == 'runtime') ? $phpversion .' ('. l($t('more information'), 'admin/reports/status/php') .')' : $phpversion, + ); + } + else { + $requirements['php'] = array( + 'title' => $t('PHP'), + 'value' => $phpversion, + '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, please read the Enabling and disabling phpinfo() handbook page.', array('@phpinfo' => 'http://drupal.org/node/243993')), + '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']['severity'] = REQUIREMENT_ERROR; } -- cgit v1.2.3