mirror of https://github.com/MISP/MISP
fix: export attributetags as Tag elements (like eventtags)
parent
67488923ac
commit
0e3fc2192e
|
@ -39,6 +39,13 @@ class JSONConverterTool {
|
|||
$ra = array('Attribute' => $ra);
|
||||
}
|
||||
}
|
||||
if (isset($event['Event']['Attribute'][$key]['AttributeTag'])) {
|
||||
foreach ($event['Event']['Attribute'][$key]['AttributeTag'] as $atk => $tag) {
|
||||
unset($tag['Tag']['org_id']);
|
||||
$event['Event']['Attribute'][$key]['Tag'][$atk] = $tag['Tag'];
|
||||
}
|
||||
unset($event['Event']['Attribute'][$key]['AttributeTag']);
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($event['Event']['RelatedAttribute']);
|
||||
|
|
|
@ -115,6 +115,13 @@ class XMLConverterTool {
|
|||
$event['Event']['Attribute'][$key]['SharingGroup'][0] = $event['Event']['Attribute'][$key]['SharingGroup'];
|
||||
unset($event['Event']['Attribute'][$key]['SharingGroup']);
|
||||
}
|
||||
if (isset($event['Event']['Attribute'][$key]['AttributeTag'])) {
|
||||
foreach ($event['Event']['Attribute'][$key]['AttributeTag'] as $atk => $tag) {
|
||||
unset($tag['Tag']['org_id']);
|
||||
$event['Event']['Attribute'][$key]['Tag'][$atk] = $tag['Tag'];
|
||||
}
|
||||
unset($event['Event']['Attribute'][$key]['AttributeTag']);
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($event['Event']['RelatedAttribute']);
|
||||
|
|
|
@ -1333,6 +1333,13 @@ class Event extends AppModel {
|
|||
}
|
||||
}
|
||||
}
|
||||
// unset empty attribute tags that got added because the tag wasn't exportable
|
||||
if (!empty($attribute['AttributeTag'])) {
|
||||
foreach ($attribute['AttributeTag'] as $atk => $attributeTag) {
|
||||
if (empty($attributeTag['Tag'])) unset($attribute['AttributeTag'][$atk]);
|
||||
}
|
||||
$event['AttributeTag'] = array_values($attribute['AttributeTag']);
|
||||
}
|
||||
$attribute['ShadowAttribute'] = array();
|
||||
// If a shadowattribute can be linked to an attribute, link it to it then remove it from the event
|
||||
// This is to differentiate between proposals that were made to an attribute for modification and between proposals for new attributes
|
||||
|
|
Loading…
Reference in New Issue