mirror of https://github.com/MISP/MISP
fix: Allow the export of an empty event in MISP JSON/XML format, fixes #1295
parent
e6f2ec0f2f
commit
0a9ab917d0
|
@ -2402,6 +2402,8 @@ class EventsController extends AppController {
|
||||||
);
|
);
|
||||||
$attributes = $this->Event->Attribute->fetchAttributes($this->Auth->user(), $params);
|
$attributes = $this->Event->Attribute->fetchAttributes($this->Auth->user(), $params);
|
||||||
$eventIds = array();
|
$eventIds = array();
|
||||||
|
// Add event ID if specifically specified to allow for the export of an empty event
|
||||||
|
if (isset($eventid)) $eventIds[] = $eventid;
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
if (!in_array($attribute['Attribute']['event_id'], $eventIds)) $eventIds[] = $attribute['Attribute']['event_id'];
|
if (!in_array($attribute['Attribute']['event_id'], $eventIds)) $eventIds[] = $attribute['Attribute']['event_id'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue