mirror of https://github.com/MISP/MISP
fix: [internal] EventID filter now accepts uuid and ID correctly
parent
9682ccee33
commit
98248f9706
|
@ -2200,7 +2200,23 @@ class Event extends AppModel
|
|||
{
|
||||
if (!empty($params['eventid']) && $params['eventid'] !== 'all') {
|
||||
$params['eventid'] = $this->convert_filters($params['eventid']);
|
||||
$conditions = $this->generic_add_filter($conditions, $params['eventid'], 'Event.id');
|
||||
$keys = array(
|
||||
'uuid' => 'Event.uuid',
|
||||
'id' => 'Event.id'
|
||||
);
|
||||
$id_params = array();
|
||||
foreach ($params['eventid'] as $operand => $list) {
|
||||
foreach ($list as $id) {
|
||||
if ($operand === 'OR') {
|
||||
$id_params['AND']['OR'][$keys[Validation::uuid($id) ? 'uuid' : 'id']][] = $id;
|
||||
} else if ($operand === 'AND') {
|
||||
$id_params['AND']['AND'][$keys[Validation::uuid($id) ? 'uuid' : 'id']][] = $id;
|
||||
} else {
|
||||
$id_params['AND']['NOT'][$keys[Validation::uuid($id) ? 'uuid' : 'id']][] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
$conditions['AND'][] = $id_params;
|
||||
}
|
||||
return $conditions;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue