fix: Allow the export of an empty event in MISP JSON/XML format, fixes #1295

pull/1307/head
Iglocska 2016-06-25 21:56:59 +02:00
parent e6f2ec0f2f
commit 0a9ab917d0
1 changed files with 2 additions and 0 deletions

View File

@ -2402,6 +2402,8 @@ class EventsController extends AppController {
);
$attributes = $this->Event->Attribute->fetchAttributes($this->Auth->user(), $params);
$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) {
if (!in_array($attribute['Attribute']['event_id'], $eventIds)) $eventIds[] = $attribute['Attribute']['event_id'];
}