fix: [enrichment] Fixed $event variable handling + monkey typo

pull/4338/head
chrisr3d 2019-03-18 18:17:55 +01:00
parent 81a0cd2974
commit 5dcd4dba47
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 6 additions and 4 deletions

View File

@ -5084,7 +5084,7 @@ class EventsController extends AppController
$event['Object'] = $objects;
$this->set('event', $event);
if (!empty($result['results'])) {
$this->__handleSimplifiedFormat($attribute, $module, $options, $result, $type, $render_name = 'resolved_misp_format');
$this->__handleSimplifiedFormat($attribute, $module, $options, $result, $type, $event = true, $render_name = 'resolved_misp_format');
} else {
$this->set('menuItem', 'enrichmentResults');
$this->set('title', 'Enrichment Results');
@ -5113,10 +5113,10 @@ class EventsController extends AppController
if (!is_array($result)) {
throw new Exception($result);
}
$this->__handleSimplifedFormat($attribute, $module, $options, $result, $type);
$this->__handleSimplifiedFormat($attribute, $module, $options, $result, $type);
}
private function __handleSimplififedFormat($attribute, $module, $options, $result, $type, $renderName = 'resolved_attributes')
private function __handleSimplifiedFormat($attribute, $module, $options, $result, $type, $event = false, $renderName = 'resolved_attributes')
{
$resultArray = $this->Event->handleModuleResult($result, $attribute[0]['Attribute']['event_id']);
if (isset($result['comment']) && $result['comment'] != "") {
@ -5154,7 +5154,9 @@ class EventsController extends AppController
$this->set('distributions', $distributions);
$this->set('sgs', $sgs);
$this->set('type', $type);
$this->set('event', array('Event' => $attribute[0]['Event']));
if (!$event){
$this->set('event', array('Event' => $attribute[0]['Event']));
}
$this->set('resultArray', $resultArray);
$this->set('typeList', array_keys($this->Event->Attribute->typeDefinitions));
$this->set('defaultCategories', $this->Event->Attribute->defaultCategories);