fix: [galaxyMatrix] Handle case if deprecated galaxy does not exists

pull/4635/head
mokaddem 2019-06-12 14:12:06 +02:00
parent 99b6ff84bc
commit f850abcdaa
1 changed files with 5 additions and 4 deletions

View File

@ -2015,12 +2015,13 @@ class UsersController extends AppController
'conditions' => array('GalaxyCluster.tag_name LIKE' => 'misp-galaxy:mitre-attack-pattern=' . $name . '% T%'),
'fields' => array('GalaxyCluster.tag_name')
));
$adjustedTagName = array_values($adjustedTagName)[0];
$mappingWithoutExternalId[$name] = $adjustedTagName;
$mappedTag = $mappingWithoutExternalId[$name];
if (!empty($adjustedTagName)) {
$adjustedTagName = array_values($adjustedTagName)[0];
$mappingWithoutExternalId[$name] = $adjustedTagName;
$mappedTag = $mappingWithoutExternalId[$name];
}
}
}
if (isset($mergedScore[$mappedTag])) {
$mergedScore[$mappedTag] += $v;
} else {