Prevent non-unicode characters in ifAlias (#15585)

non-unicode characters will show up oddly, but at least they won't cause an error.
This commit is contained in:
Tony Murray
2023-11-16 11:43:22 -06:00
committed by GitHub
parent 2755676131
commit c3d4edaf5e

View File

@@ -678,6 +678,7 @@ foreach ($ports as $port) {
} else {
$current_oid = \LibreNMS\Util\StringHelpers::inferEncoding($this_port['ifAlias']);
}
$current_oid = utf8_encode($current_oid); // prevent invalid non-utf8 characters
}
if ($oid == 'ifSpeed') {
$ifSpeed_override = DeviceCache::getPrimary()->getAttrib('ifSpeed:' . $port['ifName']);