diff --git a/Parser/OperatingSystem.php b/Parser/OperatingSystem.php index 632778c845..4b1e72e8b6 100644 --- a/Parser/OperatingSystem.php +++ b/Parser/OperatingSystem.php @@ -426,11 +426,11 @@ public function parse(): ?array $version = $osFromUserAgent['version']; } - if ('Fire OS' === $osFromUserAgent['name']) { - $majorVersion = (int) (\explode('.', $version, 1)[0] ?? '0'); + if ('Fire OS' === $name && !empty($osFromClientHints['version'])) { + $majorVersion = (int) (\explode('.', $version, 1)[0] ?? '0'); - $version = $this->fireOsVersionMapping[$version] - ?? $this->fireOsVersionMapping[$majorVersion] ?? ''; + $version = $this->fireOsVersionMapping[$version] + ?? $this->fireOsVersionMapping[$majorVersion] ?? ''; } } diff --git a/Tests/Parser/fixtures/oss.yml b/Tests/Parser/fixtures/oss.yml index 3f04f20821..abcca5023d 100644 --- a/Tests/Parser/fixtures/oss.yml +++ b/Tests/Parser/fixtures/oss.yml @@ -5699,3 +5699,13 @@ version: "18.2" platform: "" family: iOS +- + user_agent: Mozilla/5.0 (Linux; Android 11; AFTT) AppleWebKit/537.36 (KHTML, like Gecko) Silk/122.3.1 like Chrome/122.0.6261.160 Safari/537.36 + os: + name: Fire OS + short_name: FIR + version: "8" + platform: "" + family: Android + headers: + Sec-CH-UA-Platform: Android