From e16fb7ba3711e1ae26ff8b5578487744ee2f4fe4 Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 15 Feb 2025 10:16:45 +0100 Subject: [PATCH] Networkinfo: default to port zero --- emhttp/plugins/dynamix/include/NetworkInfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emhttp/plugins/dynamix/include/NetworkInfo.php b/emhttp/plugins/dynamix/include/NetworkInfo.php index 926dbde2a..0c9d33891 100644 --- a/emhttp/plugins/dynamix/include/NetworkInfo.php +++ b/emhttp/plugins/dynamix/include/NetworkInfo.php @@ -23,7 +23,7 @@ if (isset($_POST['listen'])) { function port($eth) { $sys = "/sys/class/net"; if (substr($eth,0,4)=='wlan') return $eth; - $x = preg_replace('/[^0-9]/','',$eth); + $x = preg_replace('/[^0-9]/','',$eth) ?: '0'; return file_exists("$sys/br{$x}") ? "br{$x}" : (file_exists("$sys/bond{$x}") ? "bond{$x}" : "eth{$x}"); }