PM-483 Browser compatibility
Fixing some undefined values.
This commit is contained in:
@@ -4374,6 +4374,7 @@ class G
|
|||||||
$bname = 'Unknown';
|
$bname = 'Unknown';
|
||||||
$platform = 'Unknown';
|
$platform = 'Unknown';
|
||||||
$version = "";
|
$version = "";
|
||||||
|
$ub = "other";
|
||||||
|
|
||||||
//First get the platform?
|
//First get the platform?
|
||||||
if (preg_match( '/linux/i', $u_agent )) {
|
if (preg_match( '/linux/i', $u_agent )) {
|
||||||
@@ -4403,11 +4404,13 @@ class G
|
|||||||
} elseif (preg_match( '/Netscape/i', $u_agent )) {
|
} elseif (preg_match( '/Netscape/i', $u_agent )) {
|
||||||
$bname = 'Netscape';
|
$bname = 'Netscape';
|
||||||
$ub = "Netscape";
|
$ub = "Netscape";
|
||||||
|
} elseif (preg_match( '/bingbot/i', $u_agent )) {
|
||||||
|
$bname = 'Bing Bot';
|
||||||
|
$ub = "bingbot";
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally get the correct version number
|
// finally get the correct version number
|
||||||
$known = array ('Version',$ub,'other'
|
$known = array ('Version',$ub,'other');
|
||||||
);
|
|
||||||
$pattern = '#(?P<browser>' . join( '|', $known ) . ')[/ ]+(?P<version>[0-9.|a-zA-Z.]*)#';
|
$pattern = '#(?P<browser>' . join( '|', $known ) . ')[/ ]+(?P<version>[0-9.|a-zA-Z.]*)#';
|
||||||
@preg_match_all( $pattern, $u_agent, $matches );
|
@preg_match_all( $pattern, $u_agent, $matches );
|
||||||
|
|
||||||
@@ -4432,7 +4435,7 @@ class G
|
|||||||
} elseif ($ub == 'Opera'){
|
} elseif ($ub == 'Opera'){
|
||||||
$parent = 'OPR';
|
$parent = 'OPR';
|
||||||
}
|
}
|
||||||
if ($parent != null || $parent != ""){
|
if (isset($parent) && $parent != ""){
|
||||||
$s = strpos(strtoupper($u_agent), $parent);
|
$s = strpos(strtoupper($u_agent), $parent);
|
||||||
$f = $s + strlen($parent);
|
$f = $s + strlen($parent);
|
||||||
$version = substr($u_agent, $f, 15);
|
$version = substr($u_agent, $f, 15);
|
||||||
|
|||||||
Reference in New Issue
Block a user