mirror of https://github.com/MISP/MISP
fix: [galaxyMatrix:export] Removed multiple bugs providing inconsistent
resultpull/4635/head
parent
2712b1c801
commit
fed5556976
|
@ -1977,7 +1977,7 @@ class UsersController extends AppController
|
|||
foreach (array_keys($scoresDataAttr['scores'] + $scoresDataEvent['scores']) as $key) {
|
||||
$scoresData[$key] = (isset($scoresDataAttr['scores'][$key]) ? $scoresDataAttr['scores'][$key] : 0) + (isset($scoresDataEvent['scores'][$key]) ? $scoresDataEvent['scores'][$key] : 0);
|
||||
}
|
||||
$maxScore = max($scoresDataAttr['maxScore'], $scoresDataEvent['maxScore']);
|
||||
$maxScore = max($scoresData);
|
||||
$scores = $scoresData;
|
||||
// FIXME: temporary fix: add the score of deprecated mitre galaxies to the new one (for the stats)
|
||||
if ($matrixData['galaxy']['id'] == $mitre_galaxy_id) {
|
||||
|
|
|
@ -3119,8 +3119,10 @@ class Attribute extends AppModel
|
|||
}
|
||||
if (!empty($results[$key])) {
|
||||
if (!empty($options['includeGalaxy'])) {
|
||||
$results[$key] = $this->Event->massageTags($results[$key], 'Attribute');
|
||||
$results[$key] = $this->Event->massageTags($results[$key], 'Event');
|
||||
$massaged_attribute = $this->Event->massageTags($results[$key], 'Attribute');
|
||||
$massaged_event = $this->Event->massageTags($results[$key], 'Event');
|
||||
$massaged_attribute['Galaxy'] = array_merge_recursive($massaged_attribute['Galaxy'], $massaged_event['Galaxy']);
|
||||
$results[$key] = $massaged_attribute;
|
||||
}
|
||||
$attributes[] = $results[$key];
|
||||
}
|
||||
|
|
|
@ -203,7 +203,10 @@ class EventTag extends AppModel
|
|||
$name = $item['Tag']['name'];
|
||||
if (in_array($name, $allowedTags)) {
|
||||
$maxScore = $score > $maxScore ? $score : $maxScore;
|
||||
$scores[$name] = $score;
|
||||
if (!isset($scores[$name])) {
|
||||
$scores[$name] = 0;
|
||||
}
|
||||
$scores[$name] += $score;
|
||||
}
|
||||
}
|
||||
return array('scores' => $scores, 'maxScore' => $maxScore);
|
||||
|
|
Loading…
Reference in New Issue