mirror of https://github.com/MISP/MISP
fix: [enrichment] Testing if an object has attributes before looping over them
parent
67f8368490
commit
8983ddf009
|
@ -5110,8 +5110,10 @@ class EventsController extends AppController
|
|||
} else {
|
||||
$tmp_object['distribution'] = (int)$tmp_object['distribution'];
|
||||
}
|
||||
foreach ($tmp_object['Attribute'] as &$tmp_attribute) {
|
||||
$tmp_attribute = $this->__fillAttribute($tmp_attribute, $defaultDistribution);
|
||||
if (isset($tmp_object['Attribute']) && $tmp_object['Attribute']) {
|
||||
foreach ($tmp_object['Attribute'] as &$tmp_attribute) {
|
||||
$tmp_attribute = $this->__fillAttribute($tmp_attribute, $defaultDistribution);
|
||||
}
|
||||
}
|
||||
array_push($objects, $tmp_object);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,10 @@
|
|||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
if (!empty($object['Attribute'])) {
|
||||
?>
|
||||
<table class="ObjectAttributes table table-condensed table-striped" style="text-align:left;margin-bottom:20px;">
|
||||
<thead>
|
||||
<th><?php echo __('Attribute');?></th>
|
||||
|
@ -135,7 +138,6 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (!empty($object['Attribute'])) {
|
||||
foreach ($object['Attribute'] as $a => $attribute) {
|
||||
echo '<tr class="ObjectAttribute">';
|
||||
echo '<td class="ObjectRelation">' . h($attribute['object_relation']) . '</td>';
|
||||
|
|
Loading…
Reference in New Issue