Issue 1774, fix for Android Opera Mini. reported by '하늘종' http://www.xpressengine.com/freeboard/20708676

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10590 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2012-04-21 16:54:03 +00:00
parent 2a62a0c3c5
commit 442ad51d8f

View file

@ -128,14 +128,29 @@ class Mobile {
{
static $UACheck;
if(isset($UACheck)) return $UACheck;
$padAgent = array('iPad','webOS','hp-tablet','PlayBook');
$padAgent = array('iPad','Android','webOS','hp-tablet','PlayBook');
// Android with 'Mobile' string is not a tablet-like device, and 'Andoroid' without 'Mobile' string is a tablet-like device.
$exceptionAgent = array(0 =>'Opera Mini','Android' => 'Mobile');
foreach($padAgent as $agent)
{
if(strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
{
$UACheck = TRUE;
return TRUE;
if(!isset($exceptionAgent[$agent]))
{
$UACheck = TRUE;
return TRUE;
}
elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
{
// Agent is the Android Opera Mini, it does not have 'Mobile' string.
if(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[0]) === FALSE)
{
$UACheck = TRUE;
return TRUE;
}
}
}
}