Skip to content

Commit f228d73

Browse files
committed
Update check for outdated php version.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent baf386b commit f228d73

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
@@ -263,17 +263,17 @@
263263
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
264264
});
265265
}
266-
if(data.phpSupported && data.phpSupported.eol) {
266+
if (data.phpSupported && data.phpSupported.eol) {
267267
messages.push({
268-
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'}),
268+
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' }),
269269
type: OC.SetupChecks.MESSAGE_TYPE_INFO
270-
});
270+
})
271271
}
272-
if(data.phpSupported && data.phpSupported.version.substr(0, 3) === '5.6') {
272+
if (data.phpSupported && data.phpSupported.version.substr(0, 3) === '7.2') {
273273
messages.push({
274-
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.'),
274+
msg: t('core', 'Nextcloud 19 is the last release supporting PHP 7.2. Nextcloud 20 requires at least PHP 7.3.'),
275275
type: OC.SetupChecks.MESSAGE_TYPE_INFO
276-
});
276+
})
277277
}
278278
if(!data.forwardedForHeadersWorking) {
279279
messages.push({

0 commit comments

Comments
 (0)