mirror of https://github.com/MISP/MISP
fix: [sync] Fixed a bug breaking the sync
parent
5d1c6ce467
commit
b36c4e82c4
|
@ -4380,13 +4380,12 @@ class Event extends AppModel
|
|||
$uuidsToCheck[$event['uuid']] = $k;
|
||||
}
|
||||
$localEvents = $this->find('list', array('recursive' => -1, 'fields' => array('Event.uuid', 'Event.timestamp')));
|
||||
$localEvents = array();
|
||||
$temp = $this->find('all', array('recursive' => -1, 'fields' => array('Event.uuid', 'Event.timestamp', 'Event.locked')));
|
||||
foreach ($temp as $e) {
|
||||
$localEvents[$e['Event']['uuid']] = array('timestamp' => $temp['Event']['timestamp'], 'locked' => $temp['Event']['locked']);
|
||||
$localEvents[$e['Event']['uuid']] = array('timestamp' => $e['Event']['timestamp'], 'locked' => $e['Event']['locked']);
|
||||
}
|
||||
foreach ($uuidsToCheck as $uuid => $eventArrayId) {
|
||||
if (isset($localEvents[$uuid]) && $localEvents[$uuid]['timestamp'] >= $eventArray[$eventArrayId]['timestamp'] || !$localEvents[$uuid]['locked']) {
|
||||
if (isset($localEvents[$uuid]) && ($localEvents[$uuid]['timestamp'] >= $eventArray[$eventArrayId]['timestamp'] || !$localEvents[$uuid]['locked'])) {
|
||||
unset($eventArray[$eventArrayId]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue