Skip to content

Commit 5b29e48

Browse files
committed
Merge remote-tracking branch 'origin/master' into stable
# Conflicts: # DeviceDetector.php
2 parents 0fe4cf8 + 37ff379 commit 5b29e48

File tree

110 files changed

+111967
-74829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+111967
-74829
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ services:
1818
before_script:
1919
- sh -c 'echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;'
2020
- (composer self-update; true)
21-
- composer require doctrine/cache ~1.2
22-
- composer install
21+
- travis_retry composer require doctrine/cache ~1.2
22+
- travis_retry composer install
2323

2424
script:
2525
- ./vendor/phpunit/phpunit/phpunit

Cache/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88

Cache/StaticCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88
namespace DeviceDetector\Cache;

DeviceDetector.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88

@@ -50,7 +50,7 @@ class DeviceDetector
5050
/**
5151
* Current version number of DeviceDetector
5252
*/
53-
const VERSION = '3.16.1';
53+
const VERSION = '3.16.2';
5454

5555
/**
5656
* Holds all registered client types
@@ -181,6 +181,7 @@ public function __construct($userAgent = '')
181181
$this->addClientParser('Library');
182182

183183
$this->addDeviceParser('HbbTv');
184+
$this->addDeviceParser('Notebook');
184185
$this->addDeviceParser('Console');
185186
$this->addDeviceParser('CarBrowser');
186187
$this->addDeviceParser('Camera');
@@ -687,8 +688,10 @@ protected function parseDevice()
687688
* Chrome on Android passes the device type based on the keyword 'Mobile'
688689
* If it is present the device should be a smartphone, otherwise it's a tablet
689690
* See https://developer.chrome.com/multidevice/user-agent#chrome_for_android_user_agent
691+
* Note: We do not check for browser (family) here, as there might be mobile apps using Chrome, that won't have
692+
* a detected browser, but can still be detected. So we check the useragent for Chrome instead.
690693
*/
691-
if (is_null($this->device) && $osFamily == 'Android' && Browser::getBrowserFamily($this->getClient('short_name')) == 'Chrome') {
694+
if (is_null($this->device) && $osFamily == 'Android' && $this->matchUserAgent('Chrome/[\.0-9]*')) {
692695
if ($this->matchUserAgent('Chrome/[\.0-9]* Mobile')) {
693696
$this->device = DeviceParserAbstract::DEVICE_TYPE_SMARTPHONE;
694697
} else if ($this->matchUserAgent('Chrome/[\.0-9]* (?!Mobile)')) {

Parser/Bot.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88
namespace DeviceDetector\Parser;
@@ -52,15 +52,15 @@ public function parse()
5252

5353
if ($this->preMatchOverall()) {
5454
if ($this->discardDetails) {
55-
$result = true;
56-
} else {
57-
foreach ($this->getRegexes() as $regex) {
58-
$matches = $this->matchUserAgent($regex['regex']);
59-
if ($matches) {
60-
unset($regex['regex']);
61-
$result = $regex;
62-
break;
63-
}
55+
return true;
56+
}
57+
58+
foreach ($this->getRegexes() as $regex) {
59+
$matches = $this->matchUserAgent($regex['regex']);
60+
if ($matches) {
61+
unset($regex['regex']);
62+
$result = $regex;
63+
break;
6464
}
6565
}
6666
}

Parser/BotParserAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88
namespace DeviceDetector\Parser;

Parser/Client/Browser.php

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88
namespace DeviceDetector\Parser\Client;
@@ -27,6 +27,7 @@ class Browser extends ClientParserAbstract
2727
* @var array
2828
*/
2929
protected static $availableBrowsers = array(
30+
'1B' => '115 Browser',
3031
'2B' => '2345 Browser',
3132
'36' => '360 Phone Browser',
3233
'3B' => '360 Browser',
@@ -39,10 +40,13 @@ class Browser extends ClientParserAbstract
3940
'AM' => 'Amaya',
4041
'AO' => 'Amigo',
4142
'AN' => 'Android Browser',
43+
'AE' => 'AOL Desktop',
4244
'AD' => 'AOL Shield',
4345
'AR' => 'Arora',
46+
'AX' => 'Arctic Fox',
4447
'AV' => 'Amiga Voyager',
4548
'AW' => 'Amiga Aweb',
49+
'A0' => 'Atom',
4650
'AT' => 'Atomic Web Browser',
4751
'AS' => 'Avast Secure Browser',
4852
'VG' => 'AVG Secure Browser',
@@ -56,12 +60,15 @@ class Browser extends ClientParserAbstract
5660
'BH' => 'BlackHawk',
5761
'BJ' => 'Bunjalloo',
5862
'BL' => 'B-Line',
63+
'BU' => 'Blue Browser',
5964
'BR' => 'Brave',
6065
'BK' => 'BriskBard',
6166
'BX' => 'BrowseX',
6267
'CA' => 'Camino',
6368
'CL' => 'CCleaner',
69+
'C0' => 'Centaury',
6470
'CC' => 'Coc Coc',
71+
'C2' => 'Colibri',
6572
'CD' => 'Comodo Dragon',
6673
'C1' => 'Coast',
6774
'CX' => 'Charon',
@@ -94,6 +101,7 @@ class Browser extends ClientParserAbstract
94101
'EI' => 'Epic',
95102
'EL' => 'Elinks',
96103
'EB' => 'Element Browser',
104+
'EE' => 'Elements Browser',
97105
'EZ' => 'eZ Browser',
98106
'EU' => 'EUI Browser',
99107
'EP' => 'GNOME Web',
@@ -114,6 +122,7 @@ class Browser extends ClientParserAbstract
114122
'FN' => 'Fireweb Navigator',
115123
'FU' => 'FreeU',
116124
'GA' => 'Galeon',
125+
'GB' => 'Glass Browser',
117126
'GE' => 'Google Earth',
118127
'HA' => 'Hawk Turbo Browser',
119128
'HO' => 'hola! Browser',
@@ -133,6 +142,7 @@ class Browser extends ClientParserAbstract
133142
'IR' => 'Iron',
134143
'JS' => 'Jasmine',
135144
'JI' => 'Jig Browser',
145+
'JP' => 'Jig Browser Plus',
136146
'JO' => 'Jio Browser',
137147
'KB' => 'K.Browser',
138148
'KI' => 'Kindle Browser',
@@ -146,10 +156,13 @@ class Browser extends ClientParserAbstract
146156
'LB' => 'Cheetah Browser',
147157
'LF' => 'LieBaoFast',
148158
'LG' => 'LG Browser',
159+
'LH' => 'Light',
149160
'LI' => 'Links',
150161
'LO' => 'Lovense Browser',
151162
'LU' => 'LuaKit',
163+
'LL' => 'Lulumi',
152164
'LS' => 'Lunascape',
165+
'LN' => 'Lunascape Lite',
153166
'LX' => 'Lynx',
154167
'M1' => 'mCent',
155168
'MB' => 'MicroB',
@@ -164,6 +177,7 @@ class Browser extends ClientParserAbstract
164177
'MN' => 'Minimo',
165178
'MT' => 'Mint Browser',
166179
'MX' => 'Maxthon',
180+
'MY' => 'Mypal',
167181
'NB' => 'Nokia Browser',
168182
'NO' => 'Nokia OSS Browser',
169183
'NV' => 'Nokia Ovi Browser',
@@ -179,6 +193,7 @@ class Browser extends ClientParserAbstract
179193
'OB' => 'Obigo',
180194
'OD' => 'Odyssey Web Browser',
181195
'OF' => 'Off By One',
196+
'HH' => 'OhHai Browser',
182197
'OE' => 'ONE Browser',
183198
'OX' => 'Opera GX',
184199
'OG' => 'Opera Neon',
@@ -190,12 +205,14 @@ class Browser extends ClientParserAbstract
190205
'OO' => 'Opera Touch',
191206
'OS' => 'Ordissimo',
192207
'OR' => 'Oregano',
208+
'O0' => 'Origin In-Game Overlay',
193209
'OY' => 'Origyn Web Browser',
194210
'OV' => 'Openwave Mobile Browser',
195211
'OW' => 'OmniWeb',
196212
'OT' => 'Otter Browser',
197213
'PL' => 'Palm Blazer',
198214
'PM' => 'Pale Moon',
215+
'PY' => 'Polypane',
199216
'PP' => 'Oppo Browser',
200217
'PR' => 'Palm Pre',
201218
'PU' => 'Puffin',
@@ -208,6 +225,7 @@ class Browser extends ClientParserAbstract
208225
'Q1' => 'QQ Browser Mini',
209226
'QQ' => 'QQ Browser',
210227
'QT' => 'Qutebrowser',
228+
'QU' => 'Quark',
211229
'QZ' => 'QupZilla',
212230
'QM' => 'Qwant Mobile',
213231
'QW' => 'QtWebEngine',
@@ -219,9 +237,11 @@ class Browser extends ClientParserAbstract
219237
'SC' => 'SEMC-Browser',
220238
'SE' => 'Sogou Explorer',
221239
'SF' => 'Safari',
240+
'S5' => 'Safe Exam Browser',
222241
'SW' => 'SalamWeb',
223242
'SH' => 'Shiira',
224243
'S1' => 'SimpleBrowser',
244+
'SY' => 'Sizzy',
225245
'SK' => 'Skyfire',
226246
'SS' => 'Seraphic Sraf',
227247
'SL' => 'Sleipnir',
@@ -232,7 +252,9 @@ class Browser extends ClientParserAbstract
232252
'SR' => 'Sunrise',
233253
'SP' => 'SuperBird',
234254
'SU' => 'Super Fast Browser',
255+
'S3' => 'surf',
235256
'S0' => 'START Internet Browser',
257+
'S4' => 'Steam In-Game Overlay',
236258
'ST' => 'Streamy',
237259
'SX' => 'Swiftfox',
238260
'SZ' => 'Seznam Browser',
@@ -241,6 +263,8 @@ class Browser extends ClientParserAbstract
241263
'TF' => 'TenFourFox',
242264
'TB' => 'Tenta Browser',
243265
'TZ' => 'Tizen Browser',
266+
'TU' => 'Tungsten',
267+
'TG' => 'ToGate',
244268
'TS' => 'TweakStyle',
245269
'TV' => 'TV Bro',
246270
'UB' => 'UBrowser',
@@ -251,16 +275,21 @@ class Browser extends ClientParserAbstract
251275
'VI' => 'Vivaldi',
252276
'VV' => 'vivo Browser',
253277
'VB' => 'Vision Mobile Browser',
278+
'VM' => 'VMware AirWatch',
254279
'WI' => 'Wear Internet Browser',
255280
'WP' => 'Web Explorer',
256281
'WE' => 'WebPositive',
257282
'WF' => 'Waterfox',
258283
'WH' => 'Whale Browser',
259284
'WO' => 'wOSBrowser',
260285
'WT' => 'WeTab Browser',
286+
'YJ' => 'Yahoo! Japan Browser',
261287
'YA' => 'Yandex Browser',
262288
'YL' => 'Yandex Browser Lite',
263-
'XI' => 'Xiino'
289+
'YN' => 'Yaani Browser',
290+
'XI' => 'Xiino',
291+
'XV' => 'Xvast',
292+
'ZV' => 'Zvu',
264293

265294
// detected browsers in older versions
266295
// 'IA' => 'Iceape', => pim
@@ -277,8 +306,8 @@ class Browser extends ClientParserAbstract
277306
'BlackBerry Browser' => array('BB'),
278307
'Baidu' => array('BD', 'BS'),
279308
'Amiga' => array('AV', 'AW'),
280-
'Chrome' => array('CH', 'BA', 'BR', 'CC', 'CD', 'CM', 'CI', 'CF', 'CN', 'CR', 'CP', 'DD', 'IR', 'RM', 'AO', 'TS', 'VI', 'PT', 'AS', 'TB', 'AD', 'SB', 'WP', 'I3', 'CV', 'WH', 'SZ', 'QW', 'LF', 'KW', '2B', 'CE', 'EC', 'MT', 'MS', 'HA', 'OC', 'MZ', 'BM', 'KN', 'SW', 'M1', 'FA', 'TA', 'AH', 'CL', 'SU', 'EU', 'UB', 'LO', 'VG', 'TV'),
281-
'Firefox' => array('FF', 'FE', 'FM', 'SX', 'FB', 'PX', 'MB', 'EI', 'WF', 'CU', 'TF', 'QM', 'FR', 'I4', 'GZ', 'MO', 'F1', 'BI', 'MN', 'BH', 'TO', 'OS', 'FY'),
309+
'Chrome' => array('CH', 'BA', 'BR', 'CC', 'CD', 'CM', 'CI', 'CF', 'CN', 'CR', 'CP', 'DD', 'IR', 'RM', 'AO', 'TS', 'VI', 'PT', 'AS', 'TB', 'AD', 'SB', 'WP', 'I3', 'CV', 'WH', 'SZ', 'QW', 'LF', 'KW', '2B', 'CE', 'EC', 'MT', 'MS', 'HA', 'OC', 'MZ', 'BM', 'KN', 'SW', 'M1', 'FA', 'TA', 'AH', 'CL', 'SU', 'EU', 'UB', 'LO', 'VG', 'TV', 'A0', '1B', 'S4', 'EE', 'AE', 'VM', 'O0', 'TG', 'GB', 'SY', 'HH', 'YJ', 'LL', 'TU', 'XV', 'C2', 'QU', 'YN'),
310+
'Firefox' => array('FF', 'FE', 'FM', 'SX', 'FB', 'PX', 'MB', 'EI', 'WF', 'CU', 'TF', 'QM', 'FR', 'I4', 'GZ', 'MO', 'F1', 'BI', 'MN', 'BH', 'TO', 'OS', 'MY', 'FY', 'AX', 'C0', 'LH', 'S5', 'ZV', 'IW'),
282311
'Internet Explorer' => array('IE', 'IM', 'PS'),
283312
'Konqueror' => array('KO'),
284313
'NetFront' => array('NF'),
@@ -295,7 +324,7 @@ class Browser extends ClientParserAbstract
295324
* @var array
296325
*/
297326
protected static $mobileOnlyBrowsers = array(
298-
'36', 'OC', 'PU', 'SK', 'MF', 'OI', 'OM', 'DD', 'DB', 'ST', 'BL', 'IV', 'FM', 'C1', 'AL', 'SA', 'SB', 'FR', 'WP', 'HA', 'NX', 'HU', 'VV', 'RE', 'CB', 'MZ', 'UM', 'FK', 'FX', 'WI', 'MN', 'M1', 'AH', 'SU', 'EU', 'EZ', 'UT', 'DT', 'S0'
327+
'36', 'OC', 'PU', 'SK', 'MF', 'OI', 'OM', 'DD', 'DB', 'ST', 'BL', 'IV', 'FM', 'C1', 'AL', 'SA', 'SB', 'FR', 'WP', 'HA', 'NX', 'HU', 'VV', 'RE', 'CB', 'MZ', 'UM', 'FK', 'FX', 'WI', 'MN', 'M1', 'AH', 'SU', 'EU', 'EZ', 'UT', 'DT', 'S0', 'QU', 'YN'
299328
);
300329

301330
/**

Parser/Client/Browser/Engine.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88
namespace DeviceDetector\Parser\Client\Browser;
@@ -40,7 +40,8 @@ class Engine extends ClientParserAbstract
4040
'NetFront',
4141
'Edge',
4242
'NetSurf',
43-
'Servo'
43+
'Servo',
44+
'Goanna'
4445
);
4546

4647
/**
@@ -54,6 +55,7 @@ public static function getAvailableEngines()
5455

5556
public function parse()
5657
{
58+
$matches = false;
5759
foreach ($this->getRegexes() as $regex) {
5860
$matches = $this->matchUserAgent($regex['regex']);
5961
if ($matches) {

Parser/Client/Browser/Engine/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Device Detector - The Universal Device Detection library for parsing User Agents
55
*
6-
* @link http://piwik.org
6+
* @link https://matomo.org
77
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
88
*/
99
namespace DeviceDetector\Parser\Client\Browser\Engine;

Parser/Client/ClientParserAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Device Detector - The Universal Device Detection library for parsing User Agents
44
*
5-
* @link http://piwik.org
5+
* @link https://matomo.org
66
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
77
*/
88
namespace DeviceDetector\Parser\Client;

0 commit comments

Comments
 (0)