From d0c5edbb71896002a5742883742c4e9f38f17d46 Mon Sep 17 00:00:00 2001 From: bergware Date: Wed, 2 Jun 2021 19:43:21 +0200 Subject: [PATCH] Suppress error in info parsing --- plugins/dynamix/DashStats.page | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/dynamix/DashStats.page b/plugins/dynamix/DashStats.page index 991cea134..ceee992f4 100644 --- a/plugins/dynamix/DashStats.page +++ b/plugins/dynamix/DashStats.page @@ -108,12 +108,12 @@ $myfile = "case-model.cfg"; $mycase = file_exists("$boot/$myfile") ? file_get_contents("$boot/$myfile") : false; $board = dmidecode('Base Board Information','2',0); -$serial = _("s/n").": {$board['Serial Number']}"; -$board = "{$board['Manufacturer']} {$board['Product Name']}".($board['Version'] ? ", "._("Version")." {$board['Version']}" : ""); +$serial = _("s/n").": ".($board['Serial Number'] ?? "--"); +$board = ($board['Manufacturer'] ?? "").' '.($board['Product Name'] ?? "").' '.(isset($board['Version']) ? ", "._("Version")." ".$board['Version'] : ""); $bios = dmidecode('BIOS Information','0',0); -$biosdate = _("BIOS dated").": "._(my_time(strtotime($bios['Release Date']),$display['date']),0); -$bios = $bios['Vendor'].($bios['Version'] ? ", "._("Version")." {$bios['Version']}" : ""); +$biosdate = _("BIOS dated").": "._(my_time(strtotime($bios['Release Date'] ?? ""),$display['date']),0); +$bios = $bios['Vendor'].(isset($bios['Version']) ? ", "._("Version")." ".$bios['Version'] : ""); $cpu = dmidecode('Processor Information','4',0); $cpumodel = str_ireplace(["Processor","(C)","(R)","(TM)"],["","©","®","™"],$cpu['Version']);