This repository has been archived by the owner. It is now read-only.

Consider iPad and iPod in two separate cases (for issue #1122) #1123

Merged
merged 2 commits into from Apr 6, 2012
Jump to file or symbol
Failed to load files and symbols.
+14 −0
Split
@@ -417,6 +417,18 @@ protected function detectPlatform($userAgent)
$this->platform = self::IPOD;
}
}
+ // In case where iPhone is not mentioed in iPad user agent string
+ elseif (stripos($userAgent, 'iPad') !== false)
+ {
+ $this->mobile = true;
+ $this->platform = self::IPAD;
+ }
+ // In case where iPhone is not mentioed in iPod user agent string
+ elseif (stripos($userAgent, 'iPod') !== false)
+ {
+ $this->mobile = true;
+ $this->platform = self::IPOD;
+ }
// This has to come after the iPhone check because mac strings are also present in iOS devices.
elseif (preg_match('/macintosh|mac os x/i', $userAgent))
{
@@ -54,6 +54,8 @@ public static function getUserAgentData()
array(JApplicationWebClient::ANDROID, true, JApplicationWebClient::WEBKIT, JApplicationWebClient::SAFARI, '4', 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'),
array(JApplicationWebClient::IPAD, true, JApplicationWebClient::WEBKIT, JApplicationWebClient::SAFARI, '4.0.4', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10gin_lib.cc'),
array(JApplicationWebClient::IPHONE, true, JApplicationWebClient::WEBKIT, JApplicationWebClient::SAFARI, '4.0.5', 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B5097d Safari/6531.22.7'),
+ array(JApplicationWebClient::IPAD, true, JApplicationWebClient::WEBKIT, JApplicationWebClient::SAFARI, '4.0.4', 'Mozilla/5.0(iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10gin_lib.cc'),
+ array(JApplicationWebClient::IPOD, true, JApplicationWebClient::WEBKIT, JApplicationWebClient::SAFARI, '4.0.4', 'Mozilla/5.0(iPod; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10gin_lib.cc'),
array(JApplicationWebClient::WINDOWS, false, JApplicationWebClient::WEBKIT, JApplicationWebClient::SAFARI, '5.0.4', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27'),
array(JApplicationWebClient::MAC, false, JApplicationWebClient::WEBKIT, JApplicationWebClient::SAFARI, '5.0.3', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; ar) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4'),
array(JApplicationWebClient::WINDOWS, false, JApplicationWebClient::GECKO, JApplicationWebClient::FIREFOX, '3.6.9', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 ( .NET CLR 3.5.30729; .NET CLR 4.0.20506)'),