From 5cb2b864627e0e10131bee65af68659783f8b390 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Tue, 27 Nov 2012 04:12:33 +0100 Subject: [PATCH 1/1] actually use the Gecko/XX.X as engine version when not a date --- include/classes/useragent.php-class | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)) { -- 2.35.3