From 9189928b7642f00fb0cc17be98ee68bb45489012 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 13 Sep 2018 08:19:33 -0500 Subject: [PATCH] use is_array() to guard against more garbage. --- LibreNMS/Component.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LibreNMS/Component.php b/LibreNMS/Component.php index bc6eb82ce6..52651e6965 100644 --- a/LibreNMS/Component.php +++ b/LibreNMS/Component.php @@ -159,10 +159,10 @@ class Component } // Sort each component array so the attributes are in order. - if (!empty($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]])) { + if (is_array($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]])) { ksort($RESULT[$RESULT[$COMPONENT['device_id']][$COMPONENT['id']]]); } - if (!empty($RESULT[$RESULT[$COMPONENT['device_id']]])) { + if (is_array($RESULT[$RESULT[$COMPONENT['device_id']]])) { ksort($RESULT[$RESULT[$COMPONENT['device_id']]]); } }