diff --git a/app/admin/sections/edit-result.php b/app/admin/sections/edit-result.php index c0b54fe98d0060ec98bcefb2ec8cb3adc8d0cab7..ecbf01d31c22e4fc475982db1c7798aec0d6115c 100755 --- a/app/admin/sections/edit-result.php +++ b/app/admin/sections/edit-result.php @@ -64,7 +64,7 @@ if ($_POST['action']=="delete" && !isset($_POST['deleteconfirm'])) { # no subsections else { $subnets = $Subnets->fetch_section_subnets ($_POST['id']); //fetch all subnets in section - $num_subnets = sizeof($subnets); + $num_subnets = is_array($subnets) ? sizeof($subnets) : 0; $ipcnt = $Addresses->count_addresses_in_multiple_subnets($subnets); } diff --git a/functions/classes/class.Sections.php b/functions/classes/class.Sections.php index 92f2f5ce43185bed6f8ba509e6b5dba1d11fc19e..e2fe3983da9bff84c6cb36d1e0b1be3f37675fe4 100644 --- a/functions/classes/class.Sections.php +++ b/functions/classes/class.Sections.php @@ -169,7 +169,7 @@ class Sections extends Common_functions { # truncate and delete all subnets in all sections, than delete sections foreach($all_ids as $id) { $section_subnets = $Subnets->fetch_section_subnets ($id); - if(sizeof($section_subnets)>0) { + if(is_array($section_subnets) && sizeof($section_subnets)>0) { foreach($section_subnets as $ss) { //delete subnet $Subnets->modify_subnet("delete", array("id"=>$ss->id));