mirror of https://github.com/MISP/MISP
chg: [UI] updated the generic element index fields
- json should accept single values without embedding them in a list - generic field should automatically cast a list to a comma separated stringpull/5296/head
parent
be509b3833
commit
9609ff1822
|
@ -1,3 +1,11 @@
|
|||
<?php
|
||||
echo h(Hash::extract($row, $field['data_path'])[0]);
|
||||
$data = Hash::extract($row, $field['data_path']);
|
||||
if (is_array($data)) {
|
||||
if (count($data) > 1) {
|
||||
$data = implode(', ', $data);
|
||||
} else {
|
||||
$data = $data[0];
|
||||
}
|
||||
}
|
||||
echo h($data);
|
||||
?>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
$data = h(Hash::extract($row, $field['data_path']));
|
||||
// I feed dirty for this...
|
||||
if (is_array($data) && count($data) === 1 && isset($data[0])) {
|
||||
$data = $data[0];
|
||||
}
|
||||
echo sprintf(
|
||||
'<div class="json_container_%s"></div>',
|
||||
h($k)
|
||||
|
|
Loading…
Reference in New Issue