Work around alert with bad data (#16287)

Avoid trying to count null by making sure it is an array
This commit is contained in:
Tony Murray
2024-08-15 18:21:50 -05:00
committed by GitHub
parent 70c2c543f3
commit 50ff4fafed

View File

@@ -314,6 +314,7 @@ class RunAlerts
$chk[$i]['ip'] = inet6_ntop($chk[$i]['ip']);
}
}
$alert['details']['rule'] ??= []; // if details.rule is missing, set it to an empty array
$o = count($alert['details']['rule']);
$n = count($chk);
$ret = 'Alert #' . $alert['id'];