Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezzzhak authored Mar 18, 2024
2 parents 0da6dca + 19e80a7 commit 60973ff
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Parser/Client/Browser/Engine/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public function parse(): ?array
return null;
}

if ('Gecko' === $this->engine) {
$pattern = '~[ ](?:rv[: ]([0-9\.]+)).*gecko/[0-9]{8,10}~i';
if ('Gecko' === $this->engine || 'Clecko' === $this->engine) {
$pattern = '~[ ](?:rv[: ]([0-9\.]+)).*(?:g|cl)ecko/[0-9]{8,10}~i';

if (\preg_match($pattern, $this->userAgent, $matches)) {
return ['version' => \array_pop($matches)];
Expand Down
7 changes: 7 additions & 0 deletions Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ public function parse(): ?array
$short = 'ADR';
$version = '';
}

if ('org.lineageos.jelly' === $this->clientHints->getApp() && 'Lineage OS' !== $name) {
$name = 'Lineage OS';
$family = 'Android';
$short = 'LEN';
$version = '';
}
}

$return = [
Expand Down
2 changes: 1 addition & 1 deletion Tests/Parser/Client/fixtures/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9003,7 +9003,7 @@
name: Classilla
version:
engine: Clecko
engine_version:
engine_version: 9.3.0
family: Firefox
-
user_agent: w3m/0.52
Expand Down
10 changes: 10 additions & 0 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4417,3 +4417,13 @@
version: "22.04"
platform: x64
family: GNU/Linux
-
user_agent: Mozilla/5.0 (Linux; Android 10; Mi Max Prime Build/QP1A.191005.007) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.186 Mobile Safari/537.36
os:
name: Lineage OS
short_name: LEN
version:
platform:
family: Android
headers:
http-x-requested-with: org.lineageos.jelly

0 comments on commit 60973ff

Please sign in to comment.