Skip to content

Commit

Permalink
Fixes #4235 Adding Windows 8.1 detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Oct 22, 2013
1 parent 0e03cf5 commit e78b9ee
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/UserAgentParser/UserAgentParser.php
Expand Up @@ -230,6 +230,7 @@ class UserAgentParser

'CYGWIN_NT-6.2' => 'WI8',
'Windows NT 6.2' => 'WI8',
'Windows NT 6.3' => 'WI8',
'Windows 8' => 'WI8',
'CYGWIN_NT-6.1' => 'WI7',
'Windows NT 6.1' => 'WI7',
Expand Down
1 change: 1 addition & 0 deletions libs/UserAgentParser/UserAgentParser.test.php
Expand Up @@ -28,6 +28,7 @@
'firefox 3.5 alpha on win7' => 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b4pre) Gecko/20090420 Shiretoko/3.5b4pre (.NET CLR 3.5.30729)',
'firefox nightly build' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0a1pre) Gecko/2008060602 Minefield/4.0a1pre',
'thunderbird 14.0 with lightning 1.6' => 'Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 Lightning/1.6',
'Windows 8' => 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko',
);
echo "Test with another user agent: ";
foreach ($testUserAgent as $name => $userAgent) {
Expand Down
Expand Up @@ -264,6 +264,9 @@
- regex: 'IEMobile[ /](\d+\.\d+)'
name: IE Mobile
version: '$1'
- regex: 'IE[ /](\d+\.\d+)'
name: Internet Explorer
version: '$1'
- regex: 'MSIE.*Trident/4.0'
name: Internet Explorer
version: 8.0
Expand Down
Expand Up @@ -81,7 +81,7 @@
##########
# Windows
##########
- regex: 'CYGWIN_NT-6.2|Windows NT 6.2|Windows 8'
- regex: 'CYGWIN_NT-6.2|Windows NT 6.2|Windows NT 6.3|Windows 8'
name: 'Windows 8'
version: '8'

Expand Down
15 changes: 15 additions & 0 deletions tests/PHPUnit/Fixtures/userAgentParserEnhancedFixtures.yml
@@ -1,3 +1,18 @@
- user_agent: Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko
os:
name: Windows 8
short_name: WI8
version: 8
browser:
name: Internet Explorer
short_name: IE
version: 11.0
device: 0
brand:
model:
os_family: Other
browser_family: Other



- user_agent: Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.22371/28.3782; U; en) Presto/2.8.119 Version/11.10
Expand Down

0 comments on commit e78b9ee

Please sign in to comment.