Merge pull request #705 from laf/snmp-fix

Added a hard limit for explode on oid
This commit is contained in:
Paul Gear
2015-04-01 08:01:06 +10:00
+1 -1
View File
@@ -58,7 +58,7 @@ function snmp_get_multi($device, $oids, $options = "-OQUs", $mib = NULL, $mibdir
{ {
list($oid,$value) = explode("=", $entry); list($oid,$value) = explode("=", $entry);
$oid = trim($oid); $value = trim($value); $oid = trim($oid); $value = trim($value);
list($oid, $index) = explode(".", $oid); list($oid, $index) = explode(".", $oid,2);
if (!strstr($value, "at this OID") && isset($oid) && isset($index)) if (!strstr($value, "at this OID") && isset($oid) && isset($index))
{ {
$array[$index][$oid] = $value; $array[$index][$oid] = $value;