mirror of https://github.com/MISP/MISP
fix: [objects:edit] Returns the latest state of the object if it were
deletedpull/6143/head
parent
ee8e468c18
commit
2169fe5717
|
@ -432,8 +432,9 @@ class ObjectsController extends AppController
|
|||
$savedObject = array();
|
||||
if (is_numeric($objectToSave)) {
|
||||
$savedObject = $this->MispObject->fetchObjects($this->Auth->user(), array('conditions' => array('Object.id' => $id)));
|
||||
if (!empty($savedObject) && isset($this->request->data['deleted']) && $this->request->data['deleted']) {
|
||||
if (isset($this->request->data['deleted']) && $this->request->data['deleted']) {
|
||||
$this->MispObject->deleteObject($savedObject[0], $hard=false, $unpublish=false);
|
||||
$savedObject = $this->MispObject->fetchObjects($this->Auth->user(), array('conditions' => array('Object.id' => $id))); // make sure the object is deleted
|
||||
}
|
||||
}
|
||||
// we pre-validate the attributes before we create an object at this point
|
||||
|
|
Loading…
Reference in New Issue