ensure detection of newer Gecko UAs works correctly
[php-utility-classes.git] / include / classes / useragent.php-class
index b6f7ab70ec9721924bb2646b67360331ded0a7dd..d941b7926bed09f27deab102c4215f5f12e78cda 100755 (executable)
@@ -1036,22 +1036,27 @@ class userAgent {
             $this->uadata['lang'] = (strpos($regs[3],'chrome://')===false)?$regs[3]:null;
             $this->uadata['eng_version'] = $regs[4];
           }
-          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); rv:([^\);]+)(; [^\)]+)?\)|', $this->uastring, $regs)) {
+          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]; ([^;]+); rv:([^\);]+)(; [^\)]+)?\)|', $this->uastring, $regs)) {
             $this->uadata['os'] = $regs[2];
             $this->uadata['lang'] = null;
             $this->uadata['eng_version'] = $regs[3];
           }
-          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) {
+          elseif (preg_match('|Mozilla/5.0 \(([^;]+); ([^;]+); ([^;]+); rv:([^\);]+)(; [^\)]+)?\)|', $this->uastring, $regs)) {
+            $this->uadata['os'] = $regs[2];
+            $this->uadata['lang'] = (strpos($regs[3],'chrome://')===false)?$regs[3]:null;
+            $this->uadata['eng_version'] = $regs[4];
+          }
+          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]; ([^;]+); ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) {
             $this->uadata['os'] = $regs[2];
             $this->uadata['lang'] = $regs[3];
             $this->uadata['eng_version'] = 'M'.$regs[4];
           }
-          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) {
+          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]; ([^;]+); m([^\);]+)\)|', $this->uastring, $regs)) {
             $this->uadata['os'] = $regs[1];
             $this->uadata['lang'] = $regs[2];
             $this->uadata['eng_version'] = 'M'.$regs[3];
           }
-          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^\);]+)\)|', $this->uastring, $regs)) {
+          elseif (preg_match('|Mozilla/5.0 \(([^;]+); [^;]; ([^;]+); ([^\);]+)\)|', $this->uastring, $regs)) {
             $this->uadata['os'] = $regs[2];
             $this->uadata['lang'] = $regs[3];
             $this->uadata['eng_version'] = null;