X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=blobdiff_plain;f=include%2Fclasses%2Fuseragent.php-class;h=eba3ed2a308a5c1a3329dce344edf70b18cb962e;hp=e71505a73c533c8e6a5693dbade5cc7370230597;hb=c863ed1ed3d36ef7bcf3dcfdb85f8c99b1655ec2;hpb=208cf8374e858cef5cc6ca2a304145dcf4e37fdd;ds=sidebyside diff --git a/include/classes/useragent.php-class b/include/classes/useragent.php-class index e71505a..eba3ed2 100755 --- a/include/classes/useragent.php-class +++ b/include/classes/useragent.php-class @@ -16,7 +16,7 @@ * * The Initial Developer of the Original Code is * KaiRo - Robert Kaiser. - * Portions created by the Initial Developer are Copyright (C) 2003 + * Portions created by the Initial Developer are Copyright (C) 2003-2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): Robert Kaiser @@ -746,7 +746,7 @@ class userAgent { if (!isset($this->uadata['engine'])) { $this->uadata['engine'] = 'unknown'; $this->uadata['geckodate'] = null; - if (preg_match('|Gecko/([0-9]+)|', $this->uastring, $regs)) { + if (preg_match('|Gecko/([0-9]+)|', $this->uastring, $regs) && (strpos($this->brand, 'Opera') === false)) { $this->uadata['engine'] = 'gecko'; $this->uadata['geckodate'] = $regs[1]; } @@ -956,6 +956,12 @@ class userAgent { $this->uadata['os'] = $regs[1]; $this->uadata['lang'] = $regs[2]; } + // Opera 9 Firefox-spoofing + elseif (preg_match('/Mozilla\/[^\(]+ \((?:X11; )?([^;]+);.+; ([a-z_-]+); rv:([^\);]+)\) Gecko\/\d+ Firefox\/[0-9a-zA-Z\.+]+ Opera [^ ]+/i', $this->uastring, $regs)) { + $this->uadata['eng_version'] = $this->getVersion(); + $this->uadata['os'] = $regs[1]; + $this->uadata['lang'] = $regs[2]; + } } elseif ($this->hasEngine('nscp')) { if (preg_match('/Mozilla\/([0-9a-zA-Z\.+]+) (?:\[([a-z_-]+)\][^\(]+)?\(X11; [^;]+; ([^\)]+)\)/i', $this->uastring, $regs)) {