mirror of https://github.com/MISP/MISP
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 expected2.3
parent
45aa7dfd8b
commit
04a63e05e6
|
@ -1 +1 @@
|
||||||
{"major":2, "minor":3, "hotfix":178}
|
{"major":2, "minor":3, "hotfix":179}
|
||||||
|
|
|
@ -1770,7 +1770,9 @@ class Event extends AppModel {
|
||||||
$eventIDs = $this->Attribute->dissectArgs($id);
|
$eventIDs = $this->Attribute->dissectArgs($id);
|
||||||
$tagIDs = $this->Attribute->dissectArgs($tags);
|
$tagIDs = $this->Attribute->dissectArgs($tags);
|
||||||
$idList = $this->getAccessibleEventIds($eventIDs[0], $eventIDs[1], $tagIDs[0], $tagIDs[1]);
|
$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);
|
$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 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) {
|
if ($attachments == "yes" || $attachments == "true" || $attachments == 1) {
|
||||||
foreach ($events as &$event) {
|
foreach ($events as &$event) {
|
||||||
|
|
Loading…
Reference in New Issue