firewall: automation: correct check order

ErrorException: Undefined array key "interface" in /usr/local/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php:154
This commit is contained in:
Stephan de Wit 2025-03-19 12:53:14 +01:00
parent ab48c5afb6
commit 9c68e2eb3c

View File

@ -151,7 +151,7 @@ class FilterController extends FilterBaseController
$is_cat = empty($categories) || array_intersect(explode(',', $record['category'] ?? ''), $categories);
if (empty($interfaces)) {
$is_if = count(explode(',', $record['interface'])) > 1 || empty($record['interface']);
$is_if = empty($record['interface']) || count(explode(',', $record['interface'])) > 1;
} else {
$is_if = array_intersect(explode(',', $record['interface'] ?? ''), $interfaces);
$is_if = $is_if || empty($record['interface']);