mirror of https://github.com/MISP/MISP
fix: [eventReport:reprotFromEvent] Make sure filtering condition are not empty
parent
a7270cc7c8
commit
08986712e1
|
@ -336,6 +336,9 @@ class EventReportsController extends AppController
|
|||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
$filters = $this->EventReport->jsonDecode($this->data['EventReport']['filters']);
|
||||
$options['conditions'] = $filters;
|
||||
$options['conditions'] = array_filter($filters, function($v) {
|
||||
return $v !== '';
|
||||
});
|
||||
$options['event_id'] = $eventId;
|
||||
App::uses('ReportFromEvent', 'EventReport');
|
||||
$optionFields = array_keys((new ReportFromEvent())->acceptedOptions);
|
||||
|
|
|
@ -33,14 +33,15 @@
|
|||
private function getAttributes()
|
||||
{
|
||||
$filterConditions = $this->__eventModel->Attribute->buildFilterConditions($this->__user, $this->__options['conditions']);
|
||||
|
||||
$options = [
|
||||
'includeWarninglistHits' => true,
|
||||
'includeSightings' => true,
|
||||
'includeCorrelations' => true,
|
||||
'conditions' => [
|
||||
'Attribute.event_id' => $this->__options['event_id'],
|
||||
'conditions' => array_merge(
|
||||
['Attribute.event_id' => $this->__options['event_id']],
|
||||
$filterConditions
|
||||
]
|
||||
)
|
||||
];
|
||||
$this->attributes = $this->__eventModel->Attribute->fetchAttributes($this->__user, $options);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue