diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 5c05c19a7c..e9f521380c 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -929,7 +929,12 @@ function netflow_get_filter_arguments($filter, $safe_input=false) // Normal filter. if ($filter['ip_dst'] != '') { - $filter_args .= ' ('; + if ($filter_args != '') { + $filter_args .= ' and ('; + } else { + $filter_args .= ' ('; + } + $val_ipdst = explode(',', io_safe_output($filter['ip_dst'])); for ($i = 0; $i < count($val_ipdst); $i++) { if ($i > 0) { @@ -1754,7 +1759,9 @@ function netflow_update_second_level_filter(&$filter, $aggregate, $sources) $filter[$extra_filter] .= ','; } - $filter[$extra_filter] = implode(',', $sources); + if (!empty($sources)) { + $filter[$extra_filter] = implode(',', $sources); + } }