mirror of https://github.com/MISP/MISP
chg: [internal] Potential fix for a race condition generating orphaned attributes, fixes #4886
- This fix will avoid issues where the delay is introduced by the deferred start of the execution via the background workers - deleting an event whilst data is being actively added will still not be interruptedpull/4965/head
parent
76ce771376
commit
47ae244514
|
@ -4120,6 +4120,9 @@ class Event extends AppModel
|
|||
$this->id = $id;
|
||||
$this->recursive = 0;
|
||||
$event = $this->read(null, $id);
|
||||
if (empty($event)) {
|
||||
return false;
|
||||
}
|
||||
if ($jobId) {
|
||||
$this->Behaviors->unload('SysLogLogable.SysLogLogable');
|
||||
} else {
|
||||
|
@ -6012,6 +6015,9 @@ class Event extends AppModel
|
|||
'recursive' => -1,
|
||||
'fields' => array('orgc_id', 'id', 'distribution', 'published', 'uuid'),
|
||||
));
|
||||
if (empty($event)) {
|
||||
return false;
|
||||
}
|
||||
$results = array();
|
||||
if (!$user['Role']['perm_site_admin'] && !empty($event) && $event['Event']['orgc_id'] != $user['org_id']) {
|
||||
$objectType = 'ShadowAttribute';
|
||||
|
|
Loading…
Reference in New Issue