Type safety check (#15409)

* Type safety check
now fails silently, we already have schema validation to check it is a string, but... people find a way.

* Fixup
This commit is contained in:
Tony Murray
2023-10-07 18:45:30 -05:00
committed by GitHub
parent e53436b6a3
commit 5386b24888

View File

@@ -445,7 +445,8 @@ class NetSnmpQuery implements SnmpQueryInterface
}
// os directory
if ($os_mibdir = Config::getOsSetting($this->device->os, 'mib_dir')) {
$os_mibdir = Config::getOsSetting($this->device->os, 'mib_dir');
if ($os_mibdir && is_string($os_mibdir)) {
$dirs[] = "$base/$os_mibdir";
} elseif (file_exists($base . '/' . $this->device->os)) {
$dirs[] = $base . '/' . $this->device->os;