Permalink
Browse files

Bug #19366iPad detection

git-svn-id: http://svn.php.net/repository/pear/packages/Net_UserAgent/trunk@326006 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
CloCkWeRX committed Jun 7, 2012
1 parent 6913fe2 commit 52f58f09555f1308ad142f0aac2be637191cf530
Showing with 3 additions and 1 deletion.
  1. +3 −1 Net/UserAgent/Detect.php
View
@@ -127,7 +127,7 @@ function detect($in_userAgent = null, $in_detect = null)
// Array that stores all of the flags for the operating systems,
// and in some cases the versions of those operating systems (windows)
$os = &Net_UserAgent_Detect::_getStaticProperty('os');
- $os = array_flip(array('win', 'win95', 'win16', 'win31', 'win9x', 'win98', 'wince', 'winme', 'win2k', 'winxp', 'winnt', 'win2003', 'vista', 'win7', 'os2', 'mac', 'mactiger', 'macleopard', 'macsnowleopard', 'mac68k', 'macppc', 'iphone', 'linux', 'unix', 'vms', 'sun', 'sun4', 'sun5', 'suni86', 'irix', 'irix5', 'irix6', 'hpux', 'hpux9', 'hpux10', 'aix', 'aix1', 'aix2', 'aix3', 'aix4', 'sco', 'unixware', 'mpras', 'reliant', 'dec', 'sinix', 'freebsd', 'bsd'));
+ $os = array_flip(array('win', 'win95', 'win16', 'win31', 'win9x', 'win98', 'wince', 'winme', 'win2k', 'winxp', 'winnt', 'win2003', 'vista', 'win7', 'os2', 'mac', 'mactiger', 'macleopard', 'macsnowleopard', 'mac68k', 'macppc', 'iphone', 'ipad', 'linux', 'unix', 'vms', 'sun', 'sun4', 'sun5', 'suni86', 'irix', 'irix5', 'irix6', 'hpux', 'hpux9', 'hpux10', 'aix', 'aix1', 'aix2', 'aix3', 'aix4', 'sco', 'unixware', 'mpras', 'reliant', 'dec', 'sinix', 'freebsd', 'bsd'));
// Array which stores known issues with the given client that can
// be used for on the fly tweaking so that the client may recieve
@@ -356,6 +356,7 @@ function detect($in_userAgent = null, $in_detect = null)
$os['mac68k'] = $os['mac'] && (strpos($agt, '68k') !== false || strpos($agt, '68000') !== false);
$os['macppc'] = $os['mac'] && (strpos($agt, 'ppc') !== false || strpos($agt, 'powerpc') !== false);
$os['iphone'] = strpos($agt, 'iphone') !== false;
+ $os['ipad'] = strpos($agt, 'ipad') !== false;
$os['sun'] = strpos($agt, 'sunos') !== false;
$os['sun4'] = strpos($agt, 'sunos 4') !== false;
$os['sun5'] = strpos($agt, 'sunos 5') !== false;
@@ -725,6 +726,7 @@ function getOSString($in_osStrings = null)
'macleopard' => 'OS X Leopard (10.5)',
'macsnowleopard' => 'OS X Snow Leopard (10.6)',
'iphone' => 'iPhone',
+ 'ipad' => 'iPad',
'os2' => 'OS/2',
'unix' => 'Linux/Unix');
}

0 comments on commit 52f58f0

Please sign in to comment.