diff --git a/src/www/diag_dump_states.php b/src/www/diag_dump_states.php index bac258e8a..9d45bb84b 100644 --- a/src/www/diag_dump_states.php +++ b/src/www/diag_dump_states.php @@ -32,9 +32,9 @@ require_once("guiconfig.inc"); require_once("interfaces.inc"); /* handle AJAX operations */ -if(isset($_POST['action']) && $_POST['action'] == "remove") { +if (isset($_POST['action']) && $_POST['action'] == "remove") { if (isset($_POST['srcip']) && isset($_POST['dstip']) && is_ipaddr($_POST['srcip']) && is_ipaddr($_POST['dstip'])) { - $retval = mwexec("/sbin/pfctl -k " . escapeshellarg($_POST['srcip']) . " -k " . escapeshellarg($_POST['dstip'])); + $retval = mwexecf('/sbin/pfctl -k %s/32 -k %s/32', array($_POST['srcip'], $_POST['dstip'])); echo htmlentities("|{$_POST['srcip']}|{$_POST['dstip']}|{$retval}|"); } else { echo gettext("invalid input"); @@ -57,9 +57,19 @@ if (isset($_POST['filter']) && isset($_POST['killfilter'])) { } } -include("head.inc"); -?> +$states_info = json_decode(configdp_run('filter list states', array(!empty($_POST['filter']) ? $_POST['filter'] : '', 10000)), true); +if (empty($states_info['details'])) { + $states_info['details'] = array(); +} + +uasort($states_info['details'], function ($a, $b) { + return strcasecmp($a['src_addr'], $b['src_addr']); +}); + +include("head.inc"); + +?>