Skip to content

Commit

Permalink
Improve device model detection for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsLeenheer committed Apr 12, 2022
1 parent 43521ad commit 344b655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Analyser/Header/Useragent/Os.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private function detectAndroid($ua)
} elseif (preg_match('/Mozilla\//ui', $ua)) {
/* Old Android useragent strings */

if (preg_match('/Linux; (?:arm; |arm_64; )?(?:U; )?Android [^;]+; (?:[a-zA-Z][a-zA-Z](?:[-_][a-zA-Z][a-zA-Z])?; )?(?:[^;]+; ?)?([^)\/;]+)\)/u', $ua, $match)) {
if (preg_match('/Linux; (?:arm; |arm_64; )?(?:U; )?Android [^;]+; (?:[a-zA-Z][a-zA-Z](?:[-_][a-zA-Z][a-zA-Z])?; )?(?:[^;]+; ?)?([^\/;]+)\) /u', $ua, $match)) {
$candidates[] = $match[1];
} elseif (preg_match('/\(([^;]+);U;Android\/[^;]+;[0-9]+\*[0-9]+;CTC\/2.0\)/u', $ua, $match)) {
$candidates[] = $match[1];
Expand Down

0 comments on commit 344b655

Please sign in to comment.