From 63ebc32d5d3cb202ad804e00a790635b214582a5 Mon Sep 17 00:00:00 2001 From: iglocska Date: Thu, 31 Jan 2019 13:27:33 +0100 Subject: [PATCH] fix: [deprecated stix export] fixed, parameters weren't correctly taken into account - affects /events/stix --- app/Controller/EventsController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index b16a78638..cce4847c3 100644 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -3801,6 +3801,9 @@ class EventsController extends AppController } else { $data = $this->request->data; } + if (!isset($data['request'])) { + $data = array('request' => $data); + } $paramArray = array('id', 'withAttachment', 'tags', 'from', 'to', 'last'); foreach ($paramArray as $p) { if (isset($data['request'][$p])) { @@ -3850,7 +3853,7 @@ class EventsController extends AppController } $this->set('data', $result['data']); } else { - throw new Exception(h($result['message'])); + throw new BadRequestException(h($result['message'])); } }