Merge branch 'ent-8024-source-ip-advanced-filter' into 'develop'

Ent 8024 source ip advanced filter

See merge request artica/pandorafms!4430
This commit is contained in:
Daniel Rodriguez 2021-10-06 08:34:56 +00:00
commit 35c877ad79
1 changed files with 9 additions and 2 deletions

View File

@ -929,7 +929,12 @@ function netflow_get_filter_arguments($filter, $safe_input=false)
// Normal filter. // Normal filter.
if ($filter['ip_dst'] != '') { if ($filter['ip_dst'] != '') {
$filter_args .= ' ('; if ($filter_args != '') {
$filter_args .= ' and (';
} else {
$filter_args .= ' (';
}
$val_ipdst = explode(',', io_safe_output($filter['ip_dst'])); $val_ipdst = explode(',', io_safe_output($filter['ip_dst']));
for ($i = 0; $i < count($val_ipdst); $i++) { for ($i = 0; $i < count($val_ipdst); $i++) {
if ($i > 0) { if ($i > 0) {
@ -1754,7 +1759,9 @@ function netflow_update_second_level_filter(&$filter, $aggregate, $sources)
$filter[$extra_filter] .= ','; $filter[$extra_filter] .= ',';
} }
$filter[$extra_filter] = implode(',', $sources); if (!empty($sources)) {
$filter[$extra_filter] = implode(',', $sources);
}
} }