projects
/
php-utility-classes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make last/avg/max VDEFs not clash with maybe manually set DEFs (modern RRD only)
[php-utility-classes.git]
/
include
/
classes
/
useragent.php-class
diff --git
a/include/classes/useragent.php-class
b/include/classes/useragent.php-class
index d060a6246a0a5aadd29d0406f9a36bf1b2a64725..12293d5f1139519fc7baacefd843e55d8a1b7c18 100755
(executable)
--- a/
include/classes/useragent.php-class
+++ b/
include/classes/useragent.php-class
@@
-68,7
+68,7
@@
class userAgent {
//
// function getEngine()
// returns a string telling the detected rendering engine, null if we can't detect
//
// 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|unk
n
own
//
// function hasEngine($rnd_engine)
// returns true if the given rendering engine was detected
//
// function hasEngine($rnd_engine)
// returns true if the given rendering engine was detected
@@
-83,7
+83,7
@@
class userAgent {
//
// function getPlatform()
// returns a string telling the detected OS platform, null if we can't detect
//
// 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|unk
n
own
//
// function getLanguage() {
// returns a string telling the detected browser UI language, null if we can't detect
//
// function getLanguage() {
// returns a string telling the detected browser UI language, null if we can't detect
@@
-217,6
+217,11
@@
class userAgent {
$this->version = $regs[1];
$this->bot = false;
}
$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];
elseif (preg_match('|Opera[ /]([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) {
$this->brand = 'Opera';
$this->version = $regs[1];
@@
-449,7
+454,7
@@
class userAgent {
foreach ($accLcomp as $lcomp) {
if (strlen($lcomp)) {
$ldef = explode(';', $lcomp);
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;
}
}
$this->uadata['accept-languages'] = $accLang;
@@
-460,9
+465,9
@@
class userAgent {
function getUAString() { return $this->uastring; }
function getEngine() {
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|unk
n
own
if (!isset($this->uadata['engine'])) {
if (!isset($this->uadata['engine'])) {
- $this->uadata['engine'] = 'unkown';
+ $this->uadata['engine'] = 'unk
n
own';
$this->uadata['geckodate'] = null;
if (preg_match('|Gecko/([0-9]+)|', $this->uastring, $regs)) {
$this->uadata['engine'] = 'gecko';
$this->uadata['geckodate'] = null;
if (preg_match('|Gecko/([0-9]+)|', $this->uastring, $regs)) {
$this->uadata['engine'] = 'gecko';
@@
-539,6
+544,11
@@
class userAgent {
$this->uadata['lang'] = $regs[3];
$this->uadata['eng_version'] = 'M'.$regs[4];
}
$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 (preg_match('|Mozilla/5.0 \(([^;]+); [^;]+; ([^;]+); ([^\);]+)\)|', $this->uastring, $regs)) {
$this->uadata['os'] = $regs[2];
$this->uadata['lang'] = $regs[3];
@@
-680,8
+690,13
@@
class userAgent {
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.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'] == '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'; }
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'; }