fix: [sync] version comparison fixes

- for determining the right version to compare to when deciding if protected events can be synced
pull/8213/head
iglocska 2022-03-14 00:34:44 +01:00
parent 4ca607ea4c
commit 4a65714fe9
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 2 additions and 7 deletions

View File

@ -2573,6 +2573,7 @@ class Server extends AppModel
$canSight = isset($remoteVersion['perm_sighting']) ? $remoteVersion['perm_sighting'] : false;
$supportEditOfGalaxyCluster = isset($remoteVersion['perm_galaxy_editor']);
$canEditGalaxyCluster = isset($remoteVersion['perm_galaxy_editor']) ? $remoteVersion['perm_galaxy_editor'] : false;
$remoteVersionString = $remoteVersion['version'];
$remoteVersion = explode('.', $remoteVersion['version']);
if (!isset($remoteVersion[0])) {
$message = __('Error: Server didn\'t send the expected response. This may be because the remote server version is outdated.');
@ -2580,13 +2581,7 @@ class Server extends AppModel
return $message;
}
$localVersion = $this->checkMISPVersion();
$localVersionString = sprintf(
'%s.%s.%s',
$localVersion['major'],
$localVersion['minor'],
$localVersion['hotfix']
);
$protectedMode = version_compare($localVersionString, '2.4.156') >= 0;
$protectedMode = version_compare($remoteVersionString, '2.4.156') >= 0;
$response = false;
$success = false;
$issueLevel = "warning";