#8024 fixed router ip

This commit is contained in:
Daniel Maya 2021-09-30 16:09:08 +02:00
parent d237fab6a6
commit 12d47cd1aa
1 changed files with 8 additions and 10 deletions

View File

@ -911,23 +911,21 @@ function netflow_get_filter_arguments($filter, $safe_input=false)
// Normal filter. // Normal filter.
if ($filter['ip_dst'] != '') { if ($filter['ip_dst'] != '') {
if ($filter_args != '') { if ($filter_args != '') {
$filter_args .= ' AND ('; $filter_args .= ' and (';
} else { } else {
$filter_args .= ' ('; $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 (!empty($val_ipdst[$i])) { if ($i > 0) {
if ($i > 0) { $filter_args .= ' or ';
$filter_args .= ' or '; }
}
if (netflow_is_net($val_ipdst[$i]) == 0) { if (netflow_is_net($val_ipdst[$i]) == 0) {
$filter_args .= 'dst ip '.$val_ipdst[$i]; $filter_args .= 'dst ip '.$val_ipdst[$i];
} else { } else {
$filter_args .= 'dst net '.$val_ipdst[$i]; $filter_args .= 'dst net '.$val_ipdst[$i];
}
} }
} }