Skip to content

Commit c8a360c

Browse files
authored
Merge pull request #19580 from nextcloud/debt/noid/outdated-check
Update check for outdated php version.
2 parents 0a6ba15 + f228d73 commit c8a360c

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

apps/settings/lib/Controller/CheckSetupController.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,8 @@ private function isUsedTlsLibOutdated() {
262262
*
263263
* @return bool
264264
*/
265-
protected function isPhpOutdated() {
266-
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
267-
return true;
268-
}
269-
270-
return false;
265+
protected function isPhpOutdated(): bool {
266+
return PHP_VERSION_ID < 70300;
271267
}
272268

273269
/**
@@ -276,7 +272,7 @@ protected function isPhpOutdated() {
276272
*
277273
* @return array
278274
*/
279-
private function isPhpSupported() {
275+
private function isPhpSupported(): array {
280276
return ['eol' => $this->isPhpOutdated(), 'version' => PHP_VERSION];
281277
}
282278

core/js/setupchecks.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,17 +264,17 @@
264264
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
265265
});
266266
}
267-
if(data.phpSupported && data.phpSupported.eol) {
267+
if (data.phpSupported && data.phpSupported.eol) {
268268
messages.push({
269-
msg: t('core', 'You are currently running PHP {version}. Upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer noopener" href="{phpLink}">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', {version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php'}),
269+
msg: t('core', 'You are currently running PHP {version}. Upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer noopener" href="{phpLink}">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', { version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php' }),
270270
type: OC.SetupChecks.MESSAGE_TYPE_INFO
271-
});
271+
})
272272
}
273-
if(data.phpSupported && data.phpSupported.version.substr(0, 3) === '5.6') {
273+
if (data.phpSupported && data.phpSupported.version.substr(0, 3) === '7.2') {
274274
messages.push({
275-
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.'),
275+
msg: t('core', 'Nextcloud 19 is the last release supporting PHP 7.2. Nextcloud 20 requires at least PHP 7.3.'),
276276
type: OC.SetupChecks.MESSAGE_TYPE_INFO
277-
});
277+
})
278278
}
279279
if(!data.forwardedForHeadersWorking) {
280280
messages.push({

0 commit comments

Comments
 (0)