fix: [API] Handle multiple event IDs being queries or not using the event ID filter when generating the CSV output file names

pull/3778/head
iglocska 2018-10-17 20:38:24 +02:00
parent 189f29cf63
commit 9057123d6d
1 changed files with 5 additions and 1 deletions

View File

@ -2716,7 +2716,11 @@ class EventsController extends AppController
if ($user === false) {
return $exception;
}
$filename = 'misp.csv.event' . $eventid . '.csv';
if (!empty($eventid) && !is_array($eventid)) {
$filename = 'misp.csv.event' . $eventid . '.csv';
} else {
$filename = 'misp.csv.filtered_results.csv';
}
$final = $this->Event->restSearch($user, 'csv', $filters);
// if it's a search, grab the attributeIDList from the session and get the IDs from it. Use those as the condition