mirror of https://github.com/MISP/MISP
fix: [enrichment] Redefinition of the '$failed' array
- Used as list and not as dict - Used to keep a list of failing attribute & objects - Attributes already present in the event are no longer saved in this list, and their uuid is saved in the '$recovered_uuids' list which is used to redirect the resolved attribute / object uuid to the same already present attribute / objectpull/4584/head
parent
5437593c4d
commit
8eb6993065
|
@ -5844,7 +5844,6 @@ class Event extends AppModel
|
|||
} else {
|
||||
$failed_attributes++;
|
||||
$lastAttributeError = $this->Attribute->validationErrors;
|
||||
$failed[$attribute['uuid']] = array('Attribute' => $attribute);
|
||||
$original_uuid = $this->Object->Attribute->find('first', array(
|
||||
'conditions' => array('Attribute.event_id' => $id, 'Attribute.object_id' => 0, 'Attribute.deleted' => 0,
|
||||
'Attribute.type' => $attribute['type'], 'Attribute.value' => $attribute['value']),
|
||||
|
@ -5853,6 +5852,8 @@ class Event extends AppModel
|
|||
));
|
||||
if (!empty($original_uuid)) {
|
||||
$recovered_uuids[$attribute['uuid']] = $original_uuid['Attribute']['uuid'];
|
||||
} else {
|
||||
$failed[] = $attribute['uuid'];
|
||||
}
|
||||
}
|
||||
if ($jobId) {
|
||||
|
|
Loading…
Reference in New Issue