detect possible FxOS tablet UA
[php-utility-classes.git] / include / classes / useragent.php-class
index 98be8ddd8d2f9d4d7cc3a66c2a70689fd05f2b77..dffa0c8fe7633fcbb08b4d531b75384305f5d90d 100755 (executable)
@@ -1177,11 +1177,11 @@ class userAgent {
             $this->uadata['eng_version'] = $regs[3];
             $this->mobile = ($regs[2] == 'Mobile');
           }
-          elseif (preg_match('|Mozilla/5.0 \(Mobile; [^;]+; rv:([^\);]+)\)|', $this->uastring, $regs)) {
+          elseif (preg_match('#Mozilla/5.0 \((Mobile|Tablet); [^;]+; rv:([^\);]+)\)#', $this->uastring, $regs)) {
             $this->uadata['os'] = 'Firefox OS';
             $this->uadata['lang'] = null;
-            $this->uadata['eng_version'] = $regs[1];
-            $this->mobile = true;
+            $this->uadata['eng_version'] = $regs[2];
+            $this->mobile = ($regs[1] == 'Mobile');
           }
           elseif (preg_match('|Mozilla/5.0 \(([^;]+); ([^;]+); rv:([^\);]+)\)|', $this->uastring, $regs)) {
             if ((strpos($regs[2], 'Linux') !== false) && ($regs[1] != 'X11')) {
@@ -1198,11 +1198,11 @@ class userAgent {
             $this->uadata['lang'] = null;
             $this->uadata['eng_version'] = null;
           }
-          elseif (preg_match('|Mozilla/5.0 \(Mobile; rv:([^\);]+)\)|', $this->uastring, $regs)) {
+          elseif (preg_match('#Mozilla/5.0 \((Mobile|Tablet); rv:([^\);]+)\)#', $this->uastring, $regs)) {
             $this->uadata['os'] = 'Firefox OS';
             $this->uadata['lang'] = null;
-            $this->uadata['eng_version'] = $regs[1];
-            $this->mobile = true;
+            $this->uadata['eng_version'] = $regs[2];
+            $this->mobile = ($regs[1] == 'Mobile');
           }
           elseif (preg_match('|Mozilla/5.0 \(([^;]+); rv:([^\);]+)\)|', $this->uastring, $regs)) {
             $this->uadata['os'] = $regs[1];