From: Robert Kaiser Date: Fri, 13 Sep 2013 01:53:35 +0000 (+0200) Subject: support Firefox OS with device specifier X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=73adc61bc3a0be12fa36b383255b0443cae0cd0b;p=php-utility-classes.git support Firefox OS with device specifier --- diff --git a/include/classes/useragent.php-class b/include/classes/useragent.php-class index 5a4b358..98be8dd 100755 --- a/include/classes/useragent.php-class +++ b/include/classes/useragent.php-class @@ -1177,6 +1177,12 @@ class userAgent { $this->uadata['eng_version'] = $regs[3]; $this->mobile = ($regs[2] == 'Mobile'); } + elseif (preg_match('|Mozilla/5.0 \(Mobile; [^;]+; rv:([^\);]+)\)|', $this->uastring, $regs)) { + $this->uadata['os'] = 'Firefox OS'; + $this->uadata['lang'] = null; + $this->uadata['eng_version'] = $regs[1]; + $this->mobile = true; + } elseif (preg_match('|Mozilla/5.0 \(([^;]+); ([^;]+); rv:([^\);]+)\)|', $this->uastring, $regs)) { if ((strpos($regs[2], 'Linux') !== false) && ($regs[1] != 'X11')) { $this->uadata['os'] = $regs[1].' ('.$regs[2].')'; diff --git a/testbed/ua_list_raw.txt b/testbed/ua_list_raw.txt index c11001d..5116e00 100755 --- a/testbed/ua_list_raw.txt +++ b/testbed/ua_list_raw.txt @@ -76,6 +76,7 @@ Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2a2pre) Gecko/2009 Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3pre) Gecko/20100403 Lorentz/3.6.3plugin2pre (.NET CLR 4.0.20506) Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007110108 prism/0.8 Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0 +Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1 Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.4pre) Gecko/20090928 Lightning/1.0pre Shredder/3.0pre Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100514 Lanikai/3.1b1 Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.0