mirror of https://github.com/MISP/MISP
chg: If no object ID is set in the URL for adding an object reference, check the payload for the object_uuid
parent
b658c20b75
commit
616fc0f9a2
|
@ -13,7 +13,15 @@ class ObjectReferencesController extends AppController {
|
|||
),
|
||||
);
|
||||
|
||||
public function add($objectId) {
|
||||
public function add($objectId = false) {
|
||||
if (empty($objectId)) {
|
||||
if ($this->request->is('post') && !empty($this->request->data['object_uuid'])) {
|
||||
$objectId = $this->request->data['object_uuid'];
|
||||
}
|
||||
}
|
||||
if (empty($objectId)) {
|
||||
throw new MethodNotAllowedException('No object defined.');
|
||||
}
|
||||
if (Validation::uuid($objectId)) {
|
||||
$temp = $this->ObjectReference->Object->find('first', array(
|
||||
'recursive' => -1,
|
||||
|
|
Loading…
Reference in New Issue