From 7dc52654db5c218b05d8aae948065ce8e4a2a8a4 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Fri, 3 Feb 2017 19:49:40 +0000 Subject: [PATCH] fix: Ignore ports where we only have two entries in the array, this signals bad data #1366 (#5722) * update to check for valid ports * fix: Ignore ports where we only have two entries in the array, this signals bad data #1366 * Update functions.php --- includes/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 75c25a3573..a3024085c2 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -955,7 +955,10 @@ function is_port_valid($port, $device) global $config; - if (strstr($port['ifDescr'], "irtual") && strpos($port['ifDescr'], "Virtual Services Platform") === false) { + if (empty($port['ifDescr']) && empty($port['ifAlias']) && empty($port['ifName'])) { + // If these are all empty, we are just going to show blank names in the ui + $valid = 0; + } elseif (strstr($port['ifDescr'], "irtual") && strpos($port['ifDescr'], "Virtual Services Platform") === false) { $valid = 0; } else { $valid = 1;