Merge branch '2.4' into develop

pull/6899/head
iglocska 2021-01-22 11:57:08 +01:00
commit 0a1c3f3458
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
3 changed files with 9 additions and 2 deletions

View File

@ -29,6 +29,7 @@ class AppController extends Controller
public $pyMispVersion = '2.4.137';
public $phpmin = '7.2';
public $phprec = '7.4';
public $phptoonew = '8.0';
public $pythonmin = '3.6';
public $pythonrec = '3.7';
private $isApiAuthed = false;

View File

@ -1180,6 +1180,7 @@ class ServersController extends AppController
$this->set('phpversion', phpversion());
$this->set('phpmin', $this->phpmin);
$this->set('phprec', $this->phprec);
$this->set('phptoonew', $this->phptoonew);
$this->set('pythonmin', $this->pythonmin);
$this->set('pythonrec', $this->pythonrec);
$this->set('pymisp', $this->pymisp);

View File

@ -122,6 +122,7 @@
$phpversions = array();
$phpversions['web']['phpversion'] = $phpversion;
$phpversions['cli']['phpversion'] = isset($extensions['cli']['phpversion']) ? $extensions['cli']['phpversion'] : false;
$phpversions['cli']['phpversion'] ='7.4.1-0ubuntu0.18.04.7';
foreach (array('web', 'cli') as $source) {
if (!$phpversions[$source]['phpversion']) {
$phpversions[$source]['phpversion'] = __('Unknown');
@ -131,14 +132,18 @@
}
$phpversions[$source]['phpcolour'] = 'green';
$phpversions[$source]['phptext'] = __('Up to date');
if (version_compare($phpversions[$source]['phpversion'], $phprec) < 1) {
if (version_compare($phpversions[$source]['phpversion'], $phprec) < 0) {
$phpversions[$source]['phpcolour'] = 'orange';
$phpversions[$source]['phptext'] = __('Update highly recommended');
if (version_compare($phpversions[$source]['phpversion'], $phpmin) < 1) {
if (version_compare($phpversions[$source]['phpversion'], $phpmin) < 0) {
$phpversions[$source]['phpcolour'] = 'red';
$phpversions[$source]['phptext'] = __('Version unsupported, update ASAP');
}
}
if (version_compare($phpversions[$source]['phpversion'], $phptoonew) >= 0) {
$phpversions[$source]['phpcolour'] = 'red';
$phpversions[$source]['phptext'] = __('Version unsupported, 8.x support not available yet.');
}
}
if (version_compare($phpversion, $phprec) < 1) {
$phpcolour = 'orange';