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

- Backported from 2.4

- 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
2.3
iglocska 2015-12-26 11:53:59 +01:00
parent 45aa7dfd8b
commit 04a63e05e6
2 changed files with 3 additions and 1 deletions

View File

@ -1 +1 @@
{"major":2, "minor":3, "hotfix":178}
{"major":2, "minor":3, "hotfix":179}

View File

@ -1770,7 +1770,9 @@ 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('Invalid Event(s).');
$events = $this->fetchEvent(null, $idList, $org, $isSiteAdmin, false, false, $from, $to, $last);
if (empty($events)) throw new Exception('Invalid Event(s).');
// If a second argument is passed (and it is either "yes", "true", or 1) base64 encode all of the attachments
if ($attachments == "yes" || $attachments == "true" || $attachments == 1) {
foreach ($events as &$event) {