//
// function getEngine()
// returns a string telling the detected rendering engine, null if we can't detect
- // one of gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|unkown
+ // one of gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|unknown
//
// function hasEngine($rnd_engine)
// returns true if the given rendering engine was detected
//
// function getPlatform()
// returns a string telling the detected OS platform, null if we can't detect
- // one of windows|linux|mac|solaris|unkown
+ // one of windows|linux|mac|solaris|unknown
//
// function getLanguage() {
// returns a string telling the detected browser UI language, null if we can't detect
$this->version = $regs[1];
$this->bot = false;
}
+ elseif (preg_match('|m([0-9]+)\)|', $this->uastring, $regs) && strstr($this->uastring, "Mozilla/") && strstr($this->uastring, "Gecko/")) {
+ $this->brand = 'Mozilla';
+ $this->version = 'M'.$regs[1];
+ $this->bot = false;
+ }
elseif (preg_match('|Opera[ /]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
$this->brand = 'Opera';
$this->version = $regs[1];
foreach ($accLcomp as $lcomp) {
if (strlen($lcomp)) {
$ldef = explode(';', $lcomp);
- $accLang[$ldef[0]] = (float)((strpos($ldef[1],'q=')===0)?substr($ldef[1],2):1);
+ $accLang[$ldef[0]] = (float)((strpos(@$ldef[1],'q=')===0)?substr($ldef[1],2):1);
}
}
$this->uadata['accept-languages'] = $accLang;
function getUAString() { return $this->uastring; }
function getEngine() {
- // return gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|unkown
+ // return gecko|khtml|trident|tasman|nscp|presto|gzilla|gtkhtml|links|unknown
if (!isset($this->uadata['engine'])) {
- $this->uadata['engine'] = 'unkown';
+ $this->uadata['engine'] = 'unknown';
$this->uadata['geckodate'] = null;
if (preg_match('|Gecko/([0-9]+)|', $this->uastring, $regs)) {
$this->uadata['engine'] = 'gecko';
$this->uadata['lang'] = $regs[3];
$this->uadata['eng_version'] = 'M'.$regs[4];
}
+ 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)) {
$this->uadata['os'] = $regs[2];
$this->uadata['lang'] = $regs[3];
elseif ($this->uadata['os'] == 'Windows NT 5.0') { $this->uadata['os'] = 'Windows 2000'; }
elseif ($this->uadata['os'] == 'Windows NT 5.1') { $this->uadata['os'] = 'Windows XP'; }
elseif ($this->uadata['os'] == 'Windows NT 5.2') { $this->uadata['os'] = 'Windows 2003'; }
+ elseif ($this->uadata['os'] == 'Windows NT 5.2 x64') { $this->uadata['os'] = 'Windows 2003 (64bit)'; }
+ elseif ($this->uadata['os'] == 'Windows NT 6.0') { $this->uadata['os'] = 'Windows Vista'; }
elseif ($this->uadata['os'] == 'Win95') { $this->uadata['os'] = 'Windows 95'; }
elseif ($this->uadata['os'] == 'Win98') { $this->uadata['os'] = 'Windows 98'; }
+ elseif ($this->uadata['os'] == 'WinNT') { $this->uadata['os'] = 'Windows NT'; }
+ elseif ($this->uadata['os'] == 'Win32') { $this->uadata['os'] = 'Windows (32bit)'; }
+ elseif ($this->uadata['os'] == 'Win64') { $this->uadata['os'] = 'Windows (64bit)'; }
elseif (preg_match('/Mac ?OS ?X/i',$this->uadata['os'])) { $this->uadata['os'] = 'MacOS X'; }
elseif (preg_match('/Mac_P(ower|)PC/i',$this->uadata['os'])) { $this->uadata['os'] = 'MacOS'; }
elseif (strpos($this->uadata['os'], 'darwin') !== false) { $this->uadata['os'] = 'MacOS X'; }