From 6485e28e4f46997c9a4da5556fc6a5c297c324a8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Jul 2022 19:20:03 +0200 Subject: [statistics] Add support for yet another JEDEC encoding scheme --- modules-available/statistics/inc/hardwareparser.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules-available/statistics/inc') diff --git a/modules-available/statistics/inc/hardwareparser.inc.php b/modules-available/statistics/inc/hardwareparser.inc.php index 2afd0564..0bad832f 100644 --- a/modules-available/statistics/inc/hardwareparser.inc.php +++ b/modules-available/statistics/inc/hardwareparser.inc.php @@ -44,7 +44,9 @@ class HardwareParser public static function decodeJedec(string $string): string { // JEDEC ID:7F 7F 9E 00 00 00 00 00 - if (preg_match('/JEDEC(?:\s*ID)?\s*:\s*([0-9a-f\s]+)/i', $string, $out)) { + // or the ID as 8 hex digits with no spacing and prefix + if (preg_match('/JEDEC(?:\s*ID)?\s*:?\s*([0-9a-f\s]+)/i', $string, $out) + || preg_match('/^([0-9a-f]{14}00)$/i', $string, $out)) { preg_match_all('/[0-9a-f]{2}/i', $out[1], $out); $bank = 0; $id = 0; -- cgit v1.2.3-55-g7522