From: Robert Kaiser Date: Tue, 27 Nov 2012 03:12:33 +0000 (+0100) Subject: actually use the Gecko/XX.X as engine version when not a date X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=5cb2b864627e0e10131bee65af68659783f8b390;p=php-utility-classes.git actually use the Gecko/XX.X as engine version when not a date --- diff --git a/include/classes/useragent.php-class b/include/classes/useragent.php-class index 108649f..4afd3e8 100755 --- a/include/classes/useragent.php-class +++ b/include/classes/useragent.php-class @@ -1037,7 +1037,13 @@ class userAgent { if (preg_match('|Gecko/([0-9\.]+)|', $this->uastring, $regs) && (strpos($this->brand, 'Opera') === false)) { $this->uadata['engine'] = 'gecko'; // If it looks like a version number, i.e. shorter than 4 chars or has a . in it, it's no date. - $this->uadata['geckodate'] = ((strlen($regs[1]) > 4) && (strpos($regs[1], '.') === false))?$regs[1]:null; + if ((strlen($regs[1]) > 4) && (strpos($regs[1], '.') === false)) { + $this->uadata['geckodate'] = $regs[1]; + } + else { + $this->uadata['geckodate'] = null; + $this->uadata['eng_version'] = $regs[1]; + } } elseif ((strpos($this->brand, 'Internet Explorer') !== false) || (strpos($this->brand, 'FrontPage') !== false)) { if ((strpos(strtolower($this->uastring), 'mac') !== false) && (intval($this->getVersion()) >= 5)) {