Skip to content

Commit 344b655

Browse files
committed
Improve device model detection for Android
1 parent 43521ad commit 344b655

File tree

1 file changed

+1
-1
lines changed
  • src/Analyser/Header/Useragent

1 file changed

+1
-1
lines changed

src/Analyser/Header/Useragent/Os.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ private function detectAndroid($ua)
277277
} elseif (preg_match('/Mozilla\//ui', $ua)) {
278278
/* Old Android useragent strings */
279279

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

0 commit comments

Comments
 (0)