mirror of https://github.com/MISP/MISP
fix: [MispObject] Do not unpublish synced events, fixes #4838
parent
1154036ffe
commit
b9865f719d
|
@ -3691,7 +3691,7 @@ class Event extends AppModel
|
|||
$referencesToCapture = array();
|
||||
if (!empty($data['Event']['Object'])) {
|
||||
foreach ($data['Event']['Object'] as $object) {
|
||||
$result = $this->Object->captureObject($object, $this->id, $user, $this->Log);
|
||||
$result = $this->Object->captureObject($object, $this->id, $user, $this->Log, false);
|
||||
}
|
||||
foreach ($data['Event']['Object'] as $object) {
|
||||
if (isset($object['ObjectReference'])) {
|
||||
|
|
|
@ -931,7 +931,7 @@ class MispObject extends AppModel
|
|||
return $this->id;
|
||||
}
|
||||
|
||||
public function captureObject($object, $eventId, $user, $log = false)
|
||||
public function captureObject($object, $eventId, $user, $log = false, $unpublish = true)
|
||||
{
|
||||
$this->create();
|
||||
if (!isset($object['Object'])) {
|
||||
|
@ -945,7 +945,9 @@ class MispObject extends AppModel
|
|||
}
|
||||
$object['Object']['event_id'] = $eventId;
|
||||
if ($this->save($object)) {
|
||||
$this->Event->unpublishEvent($eventId);
|
||||
if ($unpublish) {
|
||||
$this->Event->unpublishEvent($eventId);
|
||||
}
|
||||
$objectId = $this->id;
|
||||
$partialFails = array();
|
||||
if (!empty($object['Object']['Attribute'])) {
|
||||
|
|
Loading…
Reference in New Issue