mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
Issue with snmpwalk_group string splitting (#12701)
* handling invalid data for snmpwalk_group * style * new approach * new guess * split trim * cleaning
This commit is contained in:
parent
61b4c35ab1
commit
8c2a5d5a16
@ -675,7 +675,9 @@ function snmpwalk_group($device, $oid, $mib = '', $depth = 1, $array = [], $mibd
|
||||
// merge the parts into an array, creating keys if they don't exist
|
||||
$tmp = &$array;
|
||||
foreach ($parts as $part) {
|
||||
$tmp = &$tmp[trim($part, '".')];
|
||||
// we don't want to remove dots inside quotes, only outside
|
||||
$key = trim(trim($part, '.'), '"');
|
||||
$tmp = &$tmp[$key];
|
||||
}
|
||||
$tmp = trim($value, "\" \n\r"); // assign the value as the leaf
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user