mirror of https://github.com/MISP/MISP
fix: decode json ref and geographical_area properties in /noticelists/view/[noticelist_id] endpoint
parent
d57fb4bc95
commit
5e2259f00d
|
@ -171,6 +171,10 @@ class NoticelistsController extends AppController
|
|||
if (empty($noticelist)) {
|
||||
throw new NotFoundException('Noticelist not found.');
|
||||
}
|
||||
|
||||
$noticelist['Noticelist']['ref'] = json_decode($noticelist['Noticelist']['ref']);
|
||||
$noticelist['Noticelist']['geographical_area'] = json_decode($noticelist['Noticelist']['geographical_area']);
|
||||
|
||||
if ($this->_isRest()) {
|
||||
$noticelist['Noticelist']['NoticelistEntry'] = $noticelist['NoticelistEntry'];
|
||||
return $this->RestResponse->viewData($noticelist, $this->response->type());
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
$fields = array();
|
||||
foreach ($field_names as $field_name) {
|
||||
if ($field_name == 'ref' || $field_name == 'geographical_area') {
|
||||
$value = json_decode($noticelist['Noticelist'][$field_name]);
|
||||
$value = $noticelist['Noticelist'][$field_name];
|
||||
foreach ($value as $k => $v) {
|
||||
if ($field_name == 'ref') {
|
||||
$value[$k] = '<a href="' . h($v) . '">' . h($v) . '</a>';
|
||||
|
|
Loading…
Reference in New Issue