diff --git a/app/ring_groups/resources/dashboard/ring_group_forward.php b/app/ring_groups/resources/dashboard/ring_group_forward.php index 7e06103e7a..e1c0ef6b98 100644 --- a/app/ring_groups/resources/dashboard/ring_group_forward.php +++ b/app/ring_groups/resources/dashboard/ring_group_forward.php @@ -63,7 +63,7 @@ } //update ring group forwarding - if (is_array($_POST['ring_groups']) && @sizeof($_POST['ring_groups']) != 0 && permission_exists('ring_group_forward')) { + if (isset($_POST['ring_groups']) && is_array($_POST['ring_groups']) && @sizeof($_POST['ring_groups']) != 0 && permission_exists('ring_group_forward')) { //validate the token $token = new token; @@ -130,6 +130,11 @@ //determine keys and stats unset($stats); + +//set defaults + $stats['forwarding'] = 0; + $stats['active'] = 0; + if (is_array($result) && @sizeof($result) != 0) { foreach ($result as $row) { $stats['forwarding'] += $row['ring_group_forward_enabled'] == 'true' && $row['ring_group_forward_destination'] ? 1 : 0; @@ -137,10 +142,6 @@ $stats['active'] = @sizeof($result) - $stats['forwarding']; } -//set defaults - if ($stats['forwarding'] == null) { $stats['forwarding'] = 0; } - if ($stats['active'] == null) { $stats['active'] = 0; } - //set the row style $c = 0; $row_style["0"] = "row_style0"; @@ -263,7 +264,7 @@ echo "\n"; echo ""; - $n++; + //$n++; echo "\n"; echo "\n";