From c3d4edaf5e69b32c439dd7651c1e449f565c28eb Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 16 Nov 2023 11:43:22 -0600 Subject: [PATCH] Prevent non-unicode characters in ifAlias (#15585) non-unicode characters will show up oddly, but at least they won't cause an error. --- includes/polling/ports.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index e5ae184e20..91fb969366 100644 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -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']);