mirror of https://github.com/MISP/MISP
Merge pull request #7455 from righel/fix-non-deserialized-properties-view-noticelist
fix: decode json ref and geographical_area properties in /noticelists…pull/7468/head
commit
037b49e576
|
@ -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