diff --git a/Parser/Device/AbstractDeviceParser.php b/Parser/Device/AbstractDeviceParser.php index a418fd24ec..b231f306a4 100644 --- a/Parser/Device/AbstractDeviceParser.php +++ b/Parser/Device/AbstractDeviceParser.php @@ -2272,7 +2272,7 @@ protected function buildModel(string $model, array $matches): string */ protected function parseClientHints(): ?array { - if ($this->clientHints) { + if ($this->clientHints && $this->clientHints->getModel()) { $deviceType = null; $formFactors = $this->clientHints->getFormFactors(); diff --git a/Tests/fixtures/clienthints.yml b/Tests/fixtures/clienthints.yml index f7d03e7955..c81ed9f658 100644 --- a/Tests/fixtures/clienthints.yml +++ b/Tests/fixtures/clienthints.yml @@ -1200,6 +1200,29 @@ model: Explr 9 os_family: Android browser_family: Chrome +- + user_agent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/21G93 [FBAN/FBIOS;FBAV/479.1.0.33.109;FBBV/637241220;FBDV/iPhone15,2;FBMD/iPhone;FBSN/iOS;FBSV/17.6.1;FBSS/3;FBID/phone;FBLC/es_ES;FBOP/5;FBRV/639094949;IABMV/1]' + headers: + Sec-CH-UA: "" + Sec-CH-UA-Platform: "" + Sec-CH-UA-Mobile: "" + Sec-CH-UA-Full-Version: "" + Sec-CH-UA-Platform-Version: "" + Sec-CH-UA-Model: "" + os: + name: iOS + version: 17.6.1 + platform: "" + client: + type: mobile app + name: Facebook + version: 479.1.0.33.109 + device: + type: phablet + brand: Apple + model: iPhone 14 Pro + os_family: iOS + browser_family: Unknown - user_agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.134 Safari/537.36 OPR/88.0.4412.53 headers: