From 895f2433aba6951bca621abe34b06c8ed4f595ec Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Wed, 3 Sep 2008 17:42:19 +0200 Subject: [PATCH] add Google's Chrome browser UA --- include/classes/useragent.php-class | 7 ++++++- testbed/ua_list_raw.txt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/classes/useragent.php-class b/include/classes/useragent.php-class index 49184a9..be512f4 100755 --- a/include/classes/useragent.php-class +++ b/include/classes/useragent.php-class @@ -277,6 +277,11 @@ class userAgent { $this->version = $regs[1]; $this->bot = false; } + elseif (preg_match('|Chrome/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { + $this->brand = 'Chrome'; + $this->version = $regs[1]; + $this->bot = false; + } elseif (preg_match('|Safari/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { $this->brand = 'Safari'; if (preg_match('|Version/([0-9a-zA-Z\.+]+)|', $this->uastring, $vregs)) { @@ -767,7 +772,7 @@ class userAgent { } } elseif ((strpos($this->brand, 'Konqueror') !== false) || (strpos($this->brand, 'Safari') !== false) || - (strpos($this->brand, 'Shiira') !== false) || + (strpos($this->brand, 'Shiira') !== false) || (strpos($this->brand, 'Chrome') !== false) || (strpos($this->brand, 'AppleWebKit') !== false) || (strpos($this->brand, 'OmniWeb') !== false)) { $this->uadata['engine'] = 'khtml'; } diff --git a/testbed/ua_list_raw.txt b/testbed/ua_list_raw.txt index af4c66a..e698c99 100755 --- a/testbed/ua_list_raw.txt +++ b/testbed/ua_list_raw.txt @@ -105,6 +105,7 @@ Mozilla/4.5 (compatible; OmniWeb/4.1.1-v423; Mac_PowerPC) Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v540 Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.51 Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125 +Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13 Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 Opera/5.12 (Windows 2000; U) [de] Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.05 [ja] -- 2.35.3