interfaces: adjust this for moving it to stable safely

While this should work let's try not to assume how the interface
names look like and just match until the next known delimiter by
excluding it and accepting all other characters.
This commit is contained in:
Franco Fichtner 2023-06-05 08:39:29 +02:00
parent a0f2e8fac8
commit 6607268a23

View File

@ -223,7 +223,7 @@ function legacy_interface_stats($ifs = null)
$current_interface = '';
foreach ($out as $line) {
if (preg_match('/^Interface ([a-z0-9-_.:]+) \(([a-z]+[0-9]+)\):$/i', $line, $names)) {
if (preg_match('/^Interface ([^\s]+) \(([^\)]+)\):$/i', $line, $names)) {
$stats[$names[1]] = [
'device' => $names[1],
'driver' => $names[2],