Skip to content

Commit 37596b8

Browse files
Merge branch 'master' into updatereadme
2 parents 2e2c8aa + bedd142 commit 37596b8

File tree

15 files changed

+1420
-1394
lines changed

15 files changed

+1420
-1394
lines changed

DeviceDetector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ protected function getOsAttribute(string $attr): string
776776
*/
777777
protected function hasAndroidTableFragment(): bool
778778
{
779-
$regex = 'Android( [\.0-9]+)?; Tablet;|Tablet(?! PC)|.*\-tablet$';
779+
$regex = 'Android( [.0-9]+)?; Tablet;|Tablet(?! PC)|.*\-tablet$';
780780

781781
return !!$this->matchUserAgent($regex);
782782
}
@@ -788,7 +788,7 @@ protected function hasAndroidTableFragment(): bool
788788
*/
789789
protected function hasAndroidMobileFragment(): bool
790790
{
791-
$regex = 'Android( [\.0-9]+)?; Mobile;|.*\-mobile$';
791+
$regex = 'Android( [.0-9]+)?; Mobile;|.*\-mobile$';
792792

793793
return !!$this->matchUserAgent($regex);
794794
}
@@ -800,7 +800,7 @@ protected function hasAndroidMobileFragment(): bool
800800
*/
801801
protected function hasAndroidVRFragment(): bool
802802
{
803-
$regex = 'Android( [\.0-9]+)?; Mobile VR;| VR ';
803+
$regex = 'Android( [.0-9]+)?; Mobile VR;| VR ';
804804

805805
return !!$this->matchUserAgent($regex);
806806
}
@@ -959,7 +959,7 @@ protected function parseDevice(): void
959959
* a detected browser, but can still be detected. So we check the useragent for Chrome instead.
960960
*/
961961
if (null === $this->device && 'Android' === $osFamily
962-
&& $this->matchUserAgent('Chrome/[\.0-9]*')
962+
&& $this->matchUserAgent('Chrome/[.0-9]*')
963963
) {
964964
if ($this->matchUserAgent('(?:Mobile|eliboM)')) {
965965
$this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE;

Parser/Client/Browser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ class Browser extends AbstractClientParser
577577
'K1' => 'Sidekick',
578578
'S1' => 'SimpleBrowser',
579579
'3S' => 'SilverMob US',
580+
'ZB' => 'Singlebox',
580581
'SY' => 'Sizzy',
581582
'K3' => 'Skye',
582583
'SK' => 'Skyfire',
@@ -769,7 +770,7 @@ class Browser extends AbstractClientParser
769770
'M9', 'F9', '0P', '0A', 'JR', 'D3', 'TK', 'BP', '2F',
770771
'2M', 'K7', '1N', '8A', 'H7', 'X3', 'T4', 'X4', '5O',
771772
'8C', '3M', '6I', '2P', 'PU', '7I', 'X5', 'AL', '3P',
772-
'W2',
773+
'W2', 'ZB',
773774
],
774775
'Firefox' => [
775776
'FF', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1',

Parser/Client/Browser/Engine/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function parse(): ?array
4949
}
5050

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

5454
if (\preg_match($pattern, $this->userAgent, $matches)) {
5555
return ['version' => \array_pop($matches)];

Parser/Device/ShellTv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ShellTv extends AbstractDeviceParser
3636
*/
3737
public function isShellTv(): bool
3838
{
39-
$regex = '[a-z]+[ _]Shell[ _]\w{6}|tclwebkit(\d+[\.\d]*)';
39+
$regex = '[a-z]+[ _]Shell[ _]\w{6}|tclwebkit(\d+[.\d]*)';
4040
$match = $this->matchUserAgent($regex);
4141

4242
return null !== $match;

Tests/Parser/Client/fixtures/browser.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10321,3 +10321,21 @@
1032110321
engine: Blink
1032210322
engine_version: 107.0.4280.88
1032310323
family: Chrome
10324+
-
10325+
user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Skye/6.4.1 Chrome/96.0.4664.110 Electron/16.0.7 Safari/537.36
10326+
client:
10327+
type: browser
10328+
name: Skye
10329+
version: 6.4.1
10330+
engine: Blink
10331+
engine_version: 96.0.4664.110
10332+
family: Chrome
10333+
-
10334+
user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Singlebox/38.2.0 Chrome/116.0.5845.190 Electron/26.2.2 Safari/537.36
10335+
client:
10336+
type: browser
10337+
name: Singlebox
10338+
version: 38.2.0
10339+
engine: Blink
10340+
engine_version: 116.0.5845.190
10341+
family: Chrome

regexes/bots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@
981981
name: ''
982982
url: 'https://ip-guide.com'
983983

984-
- regex: 'k6/[0-9\.]+'
984+
- regex: 'k6/[0-9.]+'
985985
name: 'K6'
986986
url: 'https://k6.io/'
987987

0 commit comments

Comments
 (0)