From ef064e55bb84560c67f578ec9f159a6c4db2466b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 5 Feb 2016 21:52:05 -0500 Subject: [PATCH] Better deprecation warning about older php versions. --- CRM/Upgrade/Incremental/General.php | 10 +++------- install/index.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CRM/Upgrade/Incremental/General.php b/CRM/Upgrade/Incremental/General.php index 9be29b28a2..ad761d435e 100644 --- a/CRM/Upgrade/Incremental/General.php +++ b/CRM/Upgrade/Incremental/General.php @@ -49,16 +49,12 @@ class CRM_Upgrade_Incremental_General { */ public static function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) { if (version_compare(phpversion(), self::MIN_RECOMMENDED_PHP_VER) < 0) { - $preUpgradeMessage .= '
' . - ts('This webserver is running an outdated version of PHP (%1). The recommended version is %2 or later.', array( + $preUpgradeMessage .= '

' . + ts('This webserver is running an outdated version of PHP (%1). It is strongly recommended to upgrade to PHP %2 or later, as older versions can present a security risk.', array( 1 => phpversion(), 2 => self::MIN_RECOMMENDED_PHP_VER, )) . - '
' . - ts('You may proceed with the upgrade and CiviCRM %1 will continue working normally, but future releases will require PHP %2.', array( - 1 => $latestVer, - 2 => self::MIN_RECOMMENDED_PHP_VER, - )); + '

'; } // http://issues.civicrm.org/jira/browse/CRM-13572 diff --git a/install/index.php b/install/index.php index d0f7f0bada..0295b7c6f7 100644 --- a/install/index.php +++ b/install/index.php @@ -733,10 +733,14 @@ class InstallRequirements { $aboveMinVersion = version_compare($phpVersion, $minVersion) >= 0; $belowMaxVersion = $maxVersion ? version_compare($phpVersion, $maxVersion) < 0 : TRUE; - if ($maxVersion && $aboveMinVersion && $belowMaxVersion) { - return TRUE; - } - elseif (!$maxVersion && $aboveMinVersion) { + if ($aboveMinVersion && $belowMaxVersion) { + if (version_compare(phpversion(), CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER) < 0) { + $testDetails[2] = ts('This webserver is running an outdated version of PHP (%1). It is strongly recommended to upgrade to PHP %2 or later, as older versions can present a security risk.', array( + 1 => phpversion(), + 2 => CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER, + )); + $this->warning($testDetails); + } return TRUE; } -- 2.25.1