From f228d73b38e5f71566c8dc055f4d322c0dc22514 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sun, 23 Feb 2020 18:00:47 +0100 Subject: [PATCH] Update check for outdated php version. Signed-off-by: Daniel Kesselberg --- .../settings/lib/Controller/CheckSetupController.php | 10 +++------- core/js/setupchecks.js | 12 ++++++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index f323590ad8424..1429fd5ed8ed8 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -262,12 +262,8 @@ private function isUsedTlsLibOutdated() { * * @return bool */ - protected function isPhpOutdated() { - if (version_compare(PHP_VERSION, '7.1.0', '<')) { - return true; - } - - return false; + protected function isPhpOutdated(): bool { + return PHP_VERSION_ID < 70300; } /** @@ -276,7 +272,7 @@ protected function isPhpOutdated() { * * @return array */ - private function isPhpSupported() { + private function isPhpSupported(): array { return ['eol' => $this->isPhpOutdated(), 'version' => PHP_VERSION]; } diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index f9829954f16a6..794bf36a8ff85 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -263,17 +263,17 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } - if(data.phpSupported && data.phpSupported.eol) { + if (data.phpSupported && data.phpSupported.eol) { messages.push({ - msg: t('core', 'You are currently running PHP {version}. Upgrade your PHP version to take advantage of performance and security updates provided by the PHP Group as soon as your distribution supports it.', {version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php'}), + msg: t('core', 'You are currently running PHP {version}. Upgrade your PHP version to take advantage of performance and security updates provided by the PHP Group as soon as your distribution supports it.', { version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php' }), type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); + }) } - if(data.phpSupported && data.phpSupported.version.substr(0, 3) === '5.6') { + if (data.phpSupported && data.phpSupported.version.substr(0, 3) === '7.2') { messages.push({ - msg: t('core', 'You are currently running PHP 5.6. The current major version of Nextcloud is the last that is supported on PHP 5.6. It is recommended to upgrade the PHP version to 7.0+ to be able to upgrade to Nextcloud 14.'), + msg: t('core', 'Nextcloud 19 is the last release supporting PHP 7.2. Nextcloud 20 requires at least PHP 7.3.'), type: OC.SetupChecks.MESSAGE_TYPE_INFO - }); + }) } if(!data.forwardedForHeadersWorking) { messages.push({