mirror of https://github.com/MISP/MISP
fix: Edit events by uuid instead of id, fixes #1842
parent
c3225e0679
commit
d537fa4447
|
@ -1278,6 +1278,13 @@ class EventsController extends AppController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id = null) {
|
public function edit($id = null) {
|
||||||
|
if (Validation::uuid($id)) {
|
||||||
|
$temp = $this->Event->find('first', array('recursive' => -1, 'fields' => array('Event.id'), 'conditions' => array('Event.uuid' => $id)));
|
||||||
|
if (empty($temp)) throw new NotFoundException('Invalid event');
|
||||||
|
$id = $temp['Event']['id'];
|
||||||
|
} else if (!is_numeric($id)) {
|
||||||
|
throw new NotFoundException(__('Invalid event'));
|
||||||
|
}
|
||||||
$this->Event->id = $id;
|
$this->Event->id = $id;
|
||||||
if (!$this->Event->exists()) {
|
if (!$this->Event->exists()) {
|
||||||
throw new NotFoundException(__('Invalid event'));
|
throw new NotFoundException(__('Invalid event'));
|
||||||
|
|
Loading…
Reference in New Issue