mirror of https://github.com/MISP/MISP
fix: [tag collections] Fixed several bugs linking to the wrong tag collection when attaching them to an event/attribute
parent
783214f840
commit
515bf89766
|
@ -2841,7 +2841,7 @@ class AttributesController extends AppController
|
|||
if (preg_match('/^collection_[0-9]+$/i', $tag_id)) {
|
||||
$tagChoice = explode('_', $tag_id)[1];
|
||||
$this->loadModel('TagCollection');
|
||||
$tagCollection = $this->TagCollection->fetchTagCollection($this->Auth->user(), array('TagCollection.id' => $tag_id));
|
||||
$tagCollection = $this->TagCollection->fetchTagCollection($this->Auth->user(), array('conditions' => array('TagCollection.id' => $tagChoice)));
|
||||
if (empty($tagCollection)) {
|
||||
return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => 'Invalid Tag Collection.')), 'status'=>200, 'type' => 'json'));
|
||||
}
|
||||
|
|
|
@ -3321,7 +3321,7 @@ class EventsController extends AppController
|
|||
if (preg_match('/^collection_[0-9]+$/i', $tag_id)) {
|
||||
$tagChoice = explode('_', $tag_id)[1];
|
||||
$this->loadModel('TagCollection');
|
||||
$tagCollection = $this->TagCollection->fetchTagCollection($this->Auth->user(), array('TagCollection.id' => $tag_id));
|
||||
$tagCollection = $this->TagCollection->fetchTagCollection($this->Auth->user(), array('conditions' => array('TagCollection.id' => $tagChoice)));
|
||||
if (empty($tagCollection)) {
|
||||
return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => 'Invalid Tag Collection.')), 'status'=>200, 'type' => 'json'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue