From 2a59034193003768b3c389283d874e8f9bf7598f Mon Sep 17 00:00:00 2001 From: Aaron Daniels Date: Fri, 15 Jan 2016 16:54:02 +1000 Subject: [PATCH] - Resolved some issues identified by scrutiniser. --- includes/component.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/component.php b/includes/component.php index 6808e847b..180f0a8da 100644 --- a/includes/component.php +++ b/includes/component.php @@ -160,6 +160,7 @@ class component { $id = dbInsert($DATA, 'component'); // Create a default component array based on what was inserted. + $ARRAY = array(); $ARRAY[$id] = $DATA; unset ($ARRAY[$id]['device_id']); // This doesn't belong here. return $ARRAY; @@ -224,7 +225,7 @@ class component { if (!isset($OLD[$device_id][$COMPONENT][$ATTR])) { // We have a newly added attribute, need to insert into the DB $DATA = array('component'=>$COMPONENT, 'attribute'=>$ATTR, 'value'=>$VALUE); - $id = dbInsert($DATA, 'component_prefs'); + dbInsert($DATA, 'component_prefs'); // Log the addition to the Eventlog. log_event ("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was added with value: " . $VALUE, $device_id, 'component', $COMPONENT); @@ -247,7 +248,7 @@ class component { dbDelete('component_prefs', "`component` = ? AND `attribute` = ?",array($COMPONENT,$KEY)); // Log the addition to the Eventlog. - log_event ("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was deleted.", $COMPONENT); + log_event ("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $KEY . ", was deleted.", $COMPONENT); } }