mirror of https://github.com/MISP/MISP
parent
1234e9b03e
commit
5a38a33f9d
|
@ -2969,20 +2969,11 @@ class AttributesController extends AppController
|
|||
);
|
||||
$RearrangeTool = new RequestRearrangeTool();
|
||||
$this->request->data = $RearrangeTool->rearrangeArray($this->request->data, $rearrangeRules);
|
||||
if ($id === false) {
|
||||
if (!isset($this->request->data['attribute'])) {
|
||||
throw new NotFoundException(__('Invalid attribute'));
|
||||
}
|
||||
$id = $this->request->data['attribute'];
|
||||
}
|
||||
if ($id === 'selected') {
|
||||
if (!isset($this->request->data['attribute_ids'])) {
|
||||
throw new NotFoundException(__('Invalid attribute'));
|
||||
}
|
||||
$idList = json_decode($this->request->data['attribute_ids'], true);
|
||||
}
|
||||
$local = empty($this->params['named']['local']) ? 0 : 1;
|
||||
if (!$this->request->is('post')) {
|
||||
if ($id === false) {
|
||||
throw new NotFoundException(__('Invalid attribute'));
|
||||
}
|
||||
$this->set('local', $local);
|
||||
$this->set('object_id', $id);
|
||||
$this->set('scope', 'Attribute');
|
||||
|
@ -2990,6 +2981,18 @@ class AttributesController extends AppController
|
|||
$this->autoRender = false;
|
||||
$this->render('/Events/add_tag');
|
||||
} else {
|
||||
if ($id === false) {
|
||||
if (!isset($this->request->data['attribute'])) {
|
||||
throw new NotFoundException(__('Invalid attribute'));
|
||||
}
|
||||
$id = $this->request->data['attribute'];
|
||||
}
|
||||
if ($id === 'selected') {
|
||||
if (!isset($this->request->data['attribute_ids'])) {
|
||||
throw new NotFoundException(__('Invalid attribute'));
|
||||
}
|
||||
$idList = json_decode($this->request->data['attribute_ids'], true);
|
||||
}
|
||||
if ($tag_id === false) {
|
||||
if (!isset($this->request->data['tag'])) {
|
||||
throw new NotFoundException(__('Invalid tag'));
|
||||
|
|
Loading…
Reference in New Issue