From 72996707a39803737f8f918d06c77aab072161b3 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 6ef4cfbf..0d654c89 100644 --- a/lib/OperatingSystems/FreeBSD.php +++ b/lib/OperatingSystems/FreeBSD.php @@ -214,15 +214,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; }