Private GIT

Skip to content
Snippets Groups Projects
Unverified Commit 5bf697c7 authored by Miha Petkovsek's avatar Miha Petkovsek Committed by GitHub
Browse files

Merge pull request #3825 from NHellFire/patch/php8.x

Fix exception when deleting a section containing no subnets in PHP 8.0+
parents f5cf36e0 7392aa13
Branches
Tags
No related merge requests found
......@@ -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);
}
......
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment