From 50204fa64a34f82d358b9795121db9b15f8bea34 Mon Sep 17 00:00:00 2001 From: HouraisanNEET Date: Tue, 1 Jun 2021 23:42:45 +0800 Subject: [PATCH] Update FreeBSD::getDiskInfo() Signed-off-by: HouraisanNEET --- lib/OperatingSystems/FreeBSD.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/OperatingSystems/FreeBSD.php b/lib/OperatingSystems/FreeBSD.php index 85c6bbf6..e39d88b5 100644 --- a/lib/OperatingSystems/FreeBSD.php +++ b/lib/OperatingSystems/FreeBSD.php @@ -211,15 +211,16 @@ public function getDiskInfo(): array { } $matches = []; - $pattern = '/^(?[\w\/-]+)\s*(?\w+)\s*(?\d+)\s*(?\d+)\s*(?\d+)\s*(?\d+%)\s*(?[\w\/-]+)$/m'; + $pattern = '/^(?[\S]+)\s*(?[\S]+)\s*(?\d+)\s*(?\d+)\s*(?\d+)\s*(?\d+%)\s*(?[\w\/-]+)$/m'; $result = preg_match_all($pattern, $disks, $matches); if ($result === 0 || $result === false) { return $data; } + $excluded = ['devfs', 'fdescfs', 'tmpfs', 'devtmpfs', 'procfs', 'linprocfs', 'linsysfs']; foreach ($matches['Filesystem'] as $i => $filesystem) { - if (in_array($matches['Type'][$i], ['tmpfs', 'devtmpfs'], false)) { + if (in_array($matches['Type'][$i], $excluded, false)) { continue; }