fix: [enrichment] Fixed change on types & categories

... that should be applied on attributes level and
not on object attributes level
pull/4584/head
chrisr3d 2019-04-29 10:38:34 +02:00
parent 92f36261ca
commit 4001859c9f
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 18 additions and 18 deletions

View File

@ -161,23 +161,7 @@
foreach ($object['Attribute'] as $a => $attribute) {
echo '<tr class="ObjectAttribute">';
echo '<td class="ObjectRelation">' . h($attribute['object_relation']) . '</td>';
foreach (array('category', 'type') as $field) {
$field_header = 'class="Attribute' . ucfirst($field);
if (isset($attribute[$field])) {
if (is_array($attribute[$field])) {
echo '<td class="short" style="width:40px;text-align:center;"><select ' . $field_header . 'Select" style="padding:0px;height:20px;margin-bottom:0px;">';
foreach ($attribute[$field] as $v => $value) {
echo '<option value="' . h($value) . '" ' . ($v ? '' : 'selected="selected"') . '>' . h($value) . '</option>';
}
echo '</select></td>';
} else {
echo '<td ' . $field_header . '">' . h($attribute[$field]) . '</td>';
}
} else {
echo '<td ' . $field_header . '"></td>';
}
}
foreach (array('value', 'uuid') as $field) {
foreach ($attributeFields as $field) {
echo '<td class="Attribute' . ucfirst($field) . '">' . (isset($attribute[$field]) ? h($attribute[$field]) : '') . '</td>';
}
?>
@ -239,7 +223,23 @@
<?php
foreach ($event['Attribute'] as $a => $attribute) {
echo '<tr class="MISPAttribute">';
foreach ($attributeFields as $field) {
foreach (array('category', 'type') as $field) {
$field_header = 'class="Attribute' . ucfirst($field);
if (isset($attribute[$field])) {
if (is_array($attribute[$field])) {
echo '<td class="short" style="width:40px;text-align:center;"><select ' . $field_header . 'Select" style="padding:0px;height:20px;margin-bottom:0px;">';
foreach ($attribute[$field] as $v => $value) {
echo '<option value="' . h($value) . '" ' . ($v ? '' : 'selected="selected"') . '>' . h($value) . '</option>';
}
echo '</select></td>';
} else {
echo '<td ' . $field_header . '">' . h($attribute[$field]) . '</td>';
}
} else {
echo '<td ' . $field_header . '"></td>';
}
}
foreach (array('value', 'uuid') as $field) {
echo '<td class="Attribute' . ucfirst($field) . '">' . (isset($attribute[$field]) ? h($attribute[$field]) : '') . '</td>';
}
?>