From: Robert Kaiser Date: Sun, 26 Feb 2012 01:02:56 +0000 (+0100) Subject: correctly detect IE10, Win8, and what could be coming for future FF X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=d6672899e597f9b5b02ad896ff43fc89c9fed9b7;p=php-utility-classes.git correctly detect IE10, Win8, and what could be coming for future FF --- diff --git a/include/classes/useragent.php-class b/include/classes/useragent.php-class index a7a137c..6363e9f 100755 --- a/include/classes/useragent.php-class +++ b/include/classes/useragent.php-class @@ -933,6 +933,11 @@ class userAgent { $this->version = "9.0"; $this->bot = false; } + elseif (preg_match('|MSIE 7\.0.+Trident/6.0|', $this->uastring, $regs)) { + $this->brand = 'Microsoft Internet Explorer'; + $this->version = "10.0"; + $this->bot = false; + } elseif (preg_match('|MSIE ([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { $this->brand = 'Microsoft Internet Explorer'; $this->version = $regs[1]; @@ -1395,6 +1400,9 @@ class userAgent { elseif ($this->uadata['os'] == 'Windows NT 6.1') { $this->uadata['os'] = 'Windows 7'; } elseif ($this->uadata['os'] == 'Windows NT 6.1 (Win64)') { $this->uadata['os'] = 'Windows 7 (64bit)'; } elseif ($this->uadata['os'] == 'Windows NT 6.1 (WOW64)') { $this->uadata['os'] = 'Windows 7 (64bit)'; } + elseif ($this->uadata['os'] == 'Windows NT 6.2') { $this->uadata['os'] = 'Windows 8'; } + elseif ($this->uadata['os'] == 'Windows NT 6.2 (Win64)') { $this->uadata['os'] = 'Windows 8 (64bit)'; } + elseif ($this->uadata['os'] == 'Windows NT 6.2 (WOW64)') { $this->uadata['os'] = 'Windows 8 (64bit)'; } elseif ($this->uadata['os'] == 'Win95') { $this->uadata['os'] = 'Windows 95'; } elseif ($this->uadata['os'] == 'Win98') { $this->uadata['os'] = 'Windows 98'; } elseif ($this->uadata['os'] == 'WinNT') { $this->uadata['os'] = 'Windows NT'; } diff --git a/testbed/ua_list_raw.txt b/testbed/ua_list_raw.txt index dfdc72c..63ecf7c 100755 --- a/testbed/ua_list_raw.txt +++ b/testbed/ua_list_raw.txt @@ -44,6 +44,7 @@ Mozilla/5.0 (Windows NT 6.0; rv:2.0b6pre) Gecko/20100907 Firefox/4.0b6pre Mozilla/5.0 (Windows NT 6.2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120117 Firefox/12.0a1 Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:12.0a1) Gecko/20100101 Firefox/12.0a1 +Mozilla/5.0 (Windows NT 6.2; WOW64; rv:13.0) Gecko/13.0 Firefox/13.0 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b6pre) Gecko/20100907 Firefox/4.0b6pre @@ -122,6 +123,11 @@ Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .N Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0) Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0) Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) +Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; Tablet PC 2.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Zune 4.7; InfoPath.3) +Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Win64; x64; Trident/6.0; .NET4.0E; .NET4.0C; Tablet PC 2.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Zune 4.7; InfoPath.3) +Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0) +Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0;) +Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0) Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; Smartphone; 176x220) Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Hotbar 4.5.1.0; MSN 6.1; MSNbMSFT; MSNmen-au; MSNc00; v5m) Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; MSN 9.0;MSN 9.1; MSNbVZ02; MSNmen-us; MSNcOTH; MPLUS)