Fixes a bug on invalid event IDs passed to the STIX export causing long execution times, fixes #747

- Running a stix export for a specific ID that doesn't exist results in a full STIX export for the user (events visible to the user)
- This leads for an unnecesarily long export process when a quick export is expected
pull/796/head v2.4.2
iglocska 2015-12-26 11:32:31 +01:00
parent 66a90cd60c
commit 9e3e362ea6
2 changed files with 2 additions and 1 deletions

View File

@ -1 +1 @@
{"major":2, "minor":4, "hotfix":1}
{"major":2, "minor":4, "hotfix":2}

View File

@ -2342,6 +2342,7 @@ class Event extends AppModel {
$eventIDs = $this->Attribute->dissectArgs($id);
$tagIDs = $this->Attribute->dissectArgs($tags);
$idList = $this->getAccessibleEventIds($eventIDs[0], $eventIDs[1], $tagIDs[0], $tagIDs[1]);
if (empty($idList)) throw new Exception('No matching events found to export.');
$events = $this->fetchEvent($user, array('idList' => $idList, 'last' => $last, 'from' => $from, 'last' => $last));
if (empty($events)) throw new Exception('No matching events found to export.');