mirror of https://github.com/MISP/MISP
fix: [correlation] fixed missing passed sharing group ID array
parent
ed5f3ea79c
commit
be67304988
|
@ -2204,7 +2204,7 @@ class Attribute extends AppModel
|
|||
|
||||
$this->attachTagsToAttributes($results, $options);
|
||||
$proposals_block_attributes = Configure::read('MISP.proposals_block_attributes');
|
||||
|
||||
$sgids = $this->SharingGroup->authorizedIds($user);
|
||||
foreach ($results as &$attribute) {
|
||||
if (!empty($options['includeContext'])) {
|
||||
$attribute['Event'] = $eventsById[$attribute['Attribute']['event_id']];
|
||||
|
@ -2216,7 +2216,7 @@ class Attribute extends AppModel
|
|||
}
|
||||
if (!empty($options['includeCorrelations'])) {
|
||||
$attributeFields = array('id', 'event_id', 'object_id', 'object_relation', 'category', 'type', 'value', 'uuid', 'timestamp', 'distribution', 'sharing_group_id', 'to_ids', 'comment');
|
||||
$attribute['Attribute']['RelatedAttribute'] = $this->Correlation->getRelatedAttributes($user, $attribute['Attribute'], $attributeFields, true);
|
||||
$attribute['Attribute']['RelatedAttribute'] = $this->Correlation->getRelatedAttributes($user, $sgids, $attribute['Attribute'], $attributeFields, true);
|
||||
}
|
||||
if ($options['enforceWarninglist'] && !$this->Warninglist->filterWarninglistAttribute($attribute['Attribute'])) {
|
||||
continue;
|
||||
|
|
|
@ -824,7 +824,7 @@ class Correlation extends AppModel
|
|||
* @param bool $includeEventData Flag to include the event data in the response
|
||||
* @return array
|
||||
*/
|
||||
public function getRelatedAttributes($user, $sgids, $attribute, $fields=[], $includeEventData = false): array
|
||||
public function getRelatedAttributes($user, $sgids, $attribute, $fields=[], $includeEventData = false)
|
||||
{
|
||||
if (in_array($attribute['type'], Attribute::NON_CORRELATING_TYPES)) {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue