From f07972af430a07e9af952ea1ad58df2a7cc4c969 Mon Sep 17 00:00:00 2001 From: Iglocska Date: Wed, 25 May 2016 01:49:16 +0200 Subject: [PATCH] fix: Reverted a change that broke PyMISP's copy_list.py To be revisited for a better solution --- VERSION.json | 2 +- app/Controller/EventsController.php | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/VERSION.json b/VERSION.json index 827a547ac..a22efe877 100644 --- a/VERSION.json +++ b/VERSION.json @@ -1 +1 @@ -{"major":2, "minor":4, "hotfix":46} +{"major":2, "minor":4, "hotfix":47} diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index a222cea4b..44f04c2f0 100644 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -995,14 +995,9 @@ class EventsController extends AppController { } else { if ($this->_isRest()) { // TODO return error if REST if(is_numeric($add)) { - $this->response->location(Configure::read('MISP.baseurl') . '/events/' . $add); - $this->response->statusCode(302); - $message = 'Event already exists, if you would like to edit it, use the url in the location header.'; - $this->set('name', $message); - $this->set('message', $message); - $this->set('url', $this->here); - $this->set('_serialize', array('name', 'message', 'url')); - return false; + $this->response->header('Location', Configure::read('MISP.baseurl') . '/events/' . $add); + $this->response->send(); + throw new NotFoundException('Event already exists, if you would like to edit it, use the url in the location header.'); } $this->set('name', 'Add event failed.'); $this->set('message', 'The event could not be saved.');