Merge pull request #2134 from SaaldjorMike/issue-2132

Fixes issue where snmp_get would not return the value 0
This commit is contained in:
Neil Lathwood
2015-10-14 21:04:00 +01:00

View File

@ -1,11 +1,5 @@
<?php
// If anybody has again the idea to implement the PHP internal library calls,
// be aware that it was tried and banned by lead dev Adam
//
// TRUE STORY. THAT SHIT IS WHACK. -- adama.
function string_to_oid($string) {
$oid = strlen($string);
for ($i = 0; $i != strlen($string); $i++) {
@ -133,7 +127,7 @@ function snmp_get($device, $oid, $options=null, $mib=null, $mibdir=null) {
if (is_string($data) && (preg_match('/(No Such Instance|No Such Object|No more variables left|Authentication failure)/i', $data))) {
return false;
}
else if ($data) {
elseif ($data || $data === '0') {
return $data;
}
else {