mirror of https://github.com/MISP/MISP
fix: remove sharing groups from json output if empty
parent
a68ff5da1a
commit
dadd9b3c81
|
@ -16,6 +16,9 @@ class JSONConverterTool {
|
|||
$event['Event'][$object] = $event[$object];
|
||||
unset($event[$object]);
|
||||
}
|
||||
if ($object == 'SharingGroup' && isset($event['Event']['SharingGroup']) && empty($event['Event']['SharingGroup'])) {
|
||||
unset($event['Event']['SharingGroup']);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($event['EventTag'])) {
|
||||
|
@ -39,6 +42,9 @@ class JSONConverterTool {
|
|||
if (isset($event['Event']['Attribute'])) {
|
||||
// remove value1 and value2 from the output and remove invalid utf8 characters for the xml parser
|
||||
foreach ($event['Event']['Attribute'] as $key => $value) {
|
||||
if (isset($value['SharingGroup']) && empty($value['SharingGroup'])) {
|
||||
unset($event['Event']['Attribute'][$k]['SharingGroup']);
|
||||
}
|
||||
unset($event['Event']['Attribute'][$key]['value1']);
|
||||
unset($event['Event']['Attribute'][$key]['value2']);
|
||||
unset($event['Event']['Attribute'][$key]['category_order']);
|
||||
|
|
Loading…
Reference in New Issue