mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Issue 1774, Mobile class fix. Add Opera Mobile browser for exception. (It does not contain the information whether it is a tablet or not.)
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10592 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e92c448c54
commit
7d9a33b6ce
1 changed files with 11 additions and 5 deletions
|
|
@ -131,7 +131,8 @@ class Mobile {
|
|||
$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');
|
||||
// $exceptionAgent[0] contains exception agents for all exceptions.
|
||||
$exceptionAgent = array(0 => array('Opera Mini','Opera Mobi'),'Android' => 'Mobile');
|
||||
|
||||
foreach($padAgent as $agent)
|
||||
{
|
||||
|
|
@ -144,12 +145,17 @@ class Mobile {
|
|||
}
|
||||
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)
|
||||
// If the agent is the Android, that can be either tablet and mobile phone.
|
||||
foreach($exceptionAgent[0] as $val)
|
||||
{
|
||||
$UACheck = TRUE;
|
||||
return TRUE;
|
||||
if(strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE)
|
||||
{
|
||||
$UACheck = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
$UACheck = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue