Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../includes/vendor
File: Mobile_Detect.php
{
[1000] Fix | Delete
static $rules;
[1001] Fix | Delete
[1002] Fix | Delete
if (!$rules) {
[1003] Fix | Delete
// Merge all rules together.
[1004] Fix | Delete
$rules = array_merge(
[1005] Fix | Delete
self::$phoneDevices,
[1006] Fix | Delete
self::$tabletDevices,
[1007] Fix | Delete
self::$operatingSystems,
[1008] Fix | Delete
self::$browsers,
[1009] Fix | Delete
self::$utilities
[1010] Fix | Delete
);
[1011] Fix | Delete
}
[1012] Fix | Delete
[1013] Fix | Delete
return $rules;
[1014] Fix | Delete
}
[1015] Fix | Delete
[1016] Fix | Delete
/**
[1017] Fix | Delete
* Retrieve the current set of rules.
[1018] Fix | Delete
*
[1019] Fix | Delete
* @deprecated since version 2.6.9
[1020] Fix | Delete
*
[1021] Fix | Delete
* @return array
[1022] Fix | Delete
*/
[1023] Fix | Delete
public function getRules()
[1024] Fix | Delete
{
[1025] Fix | Delete
if ($this->detectionType == self::DETECTION_TYPE_EXTENDED) {
[1026] Fix | Delete
return self::getMobileDetectionRulesExtended();
[1027] Fix | Delete
} else {
[1028] Fix | Delete
return self::getMobileDetectionRules();
[1029] Fix | Delete
}
[1030] Fix | Delete
}
[1031] Fix | Delete
[1032] Fix | Delete
/**
[1033] Fix | Delete
* Retrieve the list of mobile operating systems.
[1034] Fix | Delete
*
[1035] Fix | Delete
* @return array The list of mobile operating systems.
[1036] Fix | Delete
*/
[1037] Fix | Delete
public static function getOperatingSystems()
[1038] Fix | Delete
{
[1039] Fix | Delete
return self::$operatingSystems;
[1040] Fix | Delete
}
[1041] Fix | Delete
[1042] Fix | Delete
/**
[1043] Fix | Delete
* Check the HTTP headers for signs of mobile.
[1044] Fix | Delete
* This is the fastest mobile check possible; it's used
[1045] Fix | Delete
* inside isMobile() method.
[1046] Fix | Delete
*
[1047] Fix | Delete
* @return bool
[1048] Fix | Delete
*/
[1049] Fix | Delete
public function checkHttpHeadersForMobile()
[1050] Fix | Delete
{
[1051] Fix | Delete
[1052] Fix | Delete
foreach ($this->getMobileHeaders() as $mobileHeader => $matchType) {
[1053] Fix | Delete
if (isset($this->httpHeaders[$mobileHeader])) {
[1054] Fix | Delete
if (is_array($matchType['matches'])) {
[1055] Fix | Delete
foreach ($matchType['matches'] as $_match) {
[1056] Fix | Delete
if (strpos($this->httpHeaders[$mobileHeader], $_match) !== false) {
[1057] Fix | Delete
return true;
[1058] Fix | Delete
}
[1059] Fix | Delete
}
[1060] Fix | Delete
[1061] Fix | Delete
return false;
[1062] Fix | Delete
} else {
[1063] Fix | Delete
return true;
[1064] Fix | Delete
}
[1065] Fix | Delete
}
[1066] Fix | Delete
}
[1067] Fix | Delete
[1068] Fix | Delete
return false;
[1069] Fix | Delete
[1070] Fix | Delete
}
[1071] Fix | Delete
[1072] Fix | Delete
/**
[1073] Fix | Delete
* Magic overloading method.
[1074] Fix | Delete
*
[1075] Fix | Delete
* @method boolean is[...]()
[1076] Fix | Delete
* @param string $name
[1077] Fix | Delete
* @param array $arguments
[1078] Fix | Delete
* @return mixed
[1079] Fix | Delete
* @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is'
[1080] Fix | Delete
*/
[1081] Fix | Delete
public function __call($name, $arguments)
[1082] Fix | Delete
{
[1083] Fix | Delete
// make sure the name starts with 'is', otherwise
[1084] Fix | Delete
if (substr($name, 0, 2) !== 'is') {
[1085] Fix | Delete
throw new BadMethodCallException("No such method exists: $name");
[1086] Fix | Delete
}
[1087] Fix | Delete
[1088] Fix | Delete
$this->setDetectionType(self::DETECTION_TYPE_MOBILE);
[1089] Fix | Delete
[1090] Fix | Delete
$key = substr($name, 2);
[1091] Fix | Delete
[1092] Fix | Delete
return $this->matchUAAgainstKey($key);
[1093] Fix | Delete
}
[1094] Fix | Delete
[1095] Fix | Delete
/**
[1096] Fix | Delete
* Find a detection rule that matches the current User-agent.
[1097] Fix | Delete
*
[1098] Fix | Delete
* @param null $userAgent deprecated
[1099] Fix | Delete
* @return boolean
[1100] Fix | Delete
*/
[1101] Fix | Delete
protected function matchDetectionRulesAgainstUA($userAgent = null)
[1102] Fix | Delete
{
[1103] Fix | Delete
// Begin general search.
[1104] Fix | Delete
foreach ($this->getRules() as $_regex) {
[1105] Fix | Delete
if (empty($_regex)) {
[1106] Fix | Delete
continue;
[1107] Fix | Delete
}
[1108] Fix | Delete
[1109] Fix | Delete
if ($this->match($_regex, $userAgent)) {
[1110] Fix | Delete
return true;
[1111] Fix | Delete
}
[1112] Fix | Delete
}
[1113] Fix | Delete
[1114] Fix | Delete
return false;
[1115] Fix | Delete
}
[1116] Fix | Delete
[1117] Fix | Delete
/**
[1118] Fix | Delete
* Search for a certain key in the rules array.
[1119] Fix | Delete
* If the key is found then try to match the corresponding
[1120] Fix | Delete
* regex against the User-Agent.
[1121] Fix | Delete
*
[1122] Fix | Delete
* @param string $key
[1123] Fix | Delete
*
[1124] Fix | Delete
* @return boolean
[1125] Fix | Delete
*/
[1126] Fix | Delete
protected function matchUAAgainstKey($key)
[1127] Fix | Delete
{
[1128] Fix | Delete
// Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc.
[1129] Fix | Delete
$key = strtolower($key);
[1130] Fix | Delete
if (false === isset($this->cache[$key])) {
[1131] Fix | Delete
[1132] Fix | Delete
// change the keys to lower case
[1133] Fix | Delete
$_rules = array_change_key_case($this->getRules());
[1134] Fix | Delete
[1135] Fix | Delete
if (false === empty($_rules[$key])) {
[1136] Fix | Delete
$this->cache[$key] = $this->match($_rules[$key]);
[1137] Fix | Delete
}
[1138] Fix | Delete
[1139] Fix | Delete
if (false === isset($this->cache[$key])) {
[1140] Fix | Delete
$this->cache[$key] = false;
[1141] Fix | Delete
}
[1142] Fix | Delete
}
[1143] Fix | Delete
[1144] Fix | Delete
return $this->cache[$key];
[1145] Fix | Delete
}
[1146] Fix | Delete
[1147] Fix | Delete
/**
[1148] Fix | Delete
* Check if the device is mobile.
[1149] Fix | Delete
* Returns true if any type of mobile device detected, including special ones
[1150] Fix | Delete
* @param null $userAgent deprecated
[1151] Fix | Delete
* @param null $httpHeaders deprecated
[1152] Fix | Delete
* @return bool
[1153] Fix | Delete
*/
[1154] Fix | Delete
public function isMobile($userAgent = null, $httpHeaders = null)
[1155] Fix | Delete
{
[1156] Fix | Delete
[1157] Fix | Delete
if ($httpHeaders) {
[1158] Fix | Delete
$this->setHttpHeaders($httpHeaders);
[1159] Fix | Delete
}
[1160] Fix | Delete
[1161] Fix | Delete
if ($userAgent) {
[1162] Fix | Delete
$this->setUserAgent($userAgent);
[1163] Fix | Delete
}
[1164] Fix | Delete
[1165] Fix | Delete
// Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront'
[1166] Fix | Delete
if ($this->getUserAgent() === 'Amazon CloudFront') {
[1167] Fix | Delete
$cfHeaders = $this->getCfHeaders();
[1168] Fix | Delete
if(array_key_exists('HTTP_CLOUDFRONT_IS_MOBILE_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_MOBILE_VIEWER'] === 'true') {
[1169] Fix | Delete
return true;
[1170] Fix | Delete
}
[1171] Fix | Delete
}
[1172] Fix | Delete
[1173] Fix | Delete
$this->setDetectionType(self::DETECTION_TYPE_MOBILE);
[1174] Fix | Delete
[1175] Fix | Delete
if ($this->checkHttpHeadersForMobile()) {
[1176] Fix | Delete
return true;
[1177] Fix | Delete
} else {
[1178] Fix | Delete
return $this->matchDetectionRulesAgainstUA();
[1179] Fix | Delete
}
[1180] Fix | Delete
[1181] Fix | Delete
}
[1182] Fix | Delete
[1183] Fix | Delete
/**
[1184] Fix | Delete
* Check if the device is a tablet.
[1185] Fix | Delete
* Return true if any type of tablet device is detected.
[1186] Fix | Delete
*
[1187] Fix | Delete
* @param string $userAgent deprecated
[1188] Fix | Delete
* @param array $httpHeaders deprecated
[1189] Fix | Delete
* @return bool
[1190] Fix | Delete
*/
[1191] Fix | Delete
public function isTablet($userAgent = null, $httpHeaders = null)
[1192] Fix | Delete
{
[1193] Fix | Delete
// Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront'
[1194] Fix | Delete
if ($this->getUserAgent() === 'Amazon CloudFront') {
[1195] Fix | Delete
$cfHeaders = $this->getCfHeaders();
[1196] Fix | Delete
if(array_key_exists('HTTP_CLOUDFRONT_IS_TABLET_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_TABLET_VIEWER'] === 'true') {
[1197] Fix | Delete
return true;
[1198] Fix | Delete
}
[1199] Fix | Delete
}
[1200] Fix | Delete
[1201] Fix | Delete
$this->setDetectionType(self::DETECTION_TYPE_MOBILE);
[1202] Fix | Delete
[1203] Fix | Delete
foreach (self::$tabletDevices as $_regex) {
[1204] Fix | Delete
if ($this->match($_regex, $userAgent)) {
[1205] Fix | Delete
return true;
[1206] Fix | Delete
}
[1207] Fix | Delete
}
[1208] Fix | Delete
[1209] Fix | Delete
return false;
[1210] Fix | Delete
}
[1211] Fix | Delete
[1212] Fix | Delete
/**
[1213] Fix | Delete
* This method checks for a certain property in the
[1214] Fix | Delete
* userAgent.
[1215] Fix | Delete
* @todo: The httpHeaders part is not yet used.
[1216] Fix | Delete
*
[1217] Fix | Delete
* @param string $key
[1218] Fix | Delete
* @param string $userAgent deprecated
[1219] Fix | Delete
* @param string $httpHeaders deprecated
[1220] Fix | Delete
* @return bool|int|null
[1221] Fix | Delete
*/
[1222] Fix | Delete
public function is($key, $userAgent = null, $httpHeaders = null)
[1223] Fix | Delete
{
[1224] Fix | Delete
// Set the UA and HTTP headers only if needed (eg. batch mode).
[1225] Fix | Delete
if ($httpHeaders) {
[1226] Fix | Delete
$this->setHttpHeaders($httpHeaders);
[1227] Fix | Delete
}
[1228] Fix | Delete
[1229] Fix | Delete
if ($userAgent) {
[1230] Fix | Delete
$this->setUserAgent($userAgent);
[1231] Fix | Delete
}
[1232] Fix | Delete
[1233] Fix | Delete
$this->setDetectionType(self::DETECTION_TYPE_EXTENDED);
[1234] Fix | Delete
[1235] Fix | Delete
return $this->matchUAAgainstKey($key);
[1236] Fix | Delete
}
[1237] Fix | Delete
[1238] Fix | Delete
/**
[1239] Fix | Delete
* Some detection rules are relative (not standard),
[1240] Fix | Delete
* because of the diversity of devices, vendors and
[1241] Fix | Delete
* their conventions in representing the User-Agent or
[1242] Fix | Delete
* the HTTP headers.
[1243] Fix | Delete
*
[1244] Fix | Delete
* This method will be used to check custom regexes against
[1245] Fix | Delete
* the User-Agent string.
[1246] Fix | Delete
*
[1247] Fix | Delete
* @param $regex
[1248] Fix | Delete
* @param string $userAgent
[1249] Fix | Delete
* @return bool
[1250] Fix | Delete
*
[1251] Fix | Delete
* @todo: search in the HTTP headers too.
[1252] Fix | Delete
*/
[1253] Fix | Delete
public function match($regex, $userAgent = null)
[1254] Fix | Delete
{
[1255] Fix | Delete
$match = (bool) preg_match(sprintf('#%s#is', $regex), (false === empty($userAgent) ? $userAgent : $this->userAgent), $matches);
[1256] Fix | Delete
// If positive match is found, store the results for debug.
[1257] Fix | Delete
if ($match) {
[1258] Fix | Delete
$this->matchingRegex = $regex;
[1259] Fix | Delete
$this->matchesArray = $matches;
[1260] Fix | Delete
}
[1261] Fix | Delete
[1262] Fix | Delete
return $match;
[1263] Fix | Delete
}
[1264] Fix | Delete
[1265] Fix | Delete
/**
[1266] Fix | Delete
* Get the properties array.
[1267] Fix | Delete
*
[1268] Fix | Delete
* @return array
[1269] Fix | Delete
*/
[1270] Fix | Delete
public static function getProperties()
[1271] Fix | Delete
{
[1272] Fix | Delete
return self::$properties;
[1273] Fix | Delete
}
[1274] Fix | Delete
[1275] Fix | Delete
/**
[1276] Fix | Delete
* Prepare the version number.
[1277] Fix | Delete
*
[1278] Fix | Delete
* @todo Remove the error supression from str_replace() call.
[1279] Fix | Delete
*
[1280] Fix | Delete
* @param string $ver The string version, like "2.6.21.2152";
[1281] Fix | Delete
*
[1282] Fix | Delete
* @return float
[1283] Fix | Delete
*/
[1284] Fix | Delete
public function prepareVersionNo($ver)
[1285] Fix | Delete
{
[1286] Fix | Delete
$ver = str_replace(array('_', ' ', '/'), '.', $ver);
[1287] Fix | Delete
$arrVer = explode('.', $ver, 2);
[1288] Fix | Delete
[1289] Fix | Delete
if (isset($arrVer[1])) {
[1290] Fix | Delete
$arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions.
[1291] Fix | Delete
}
[1292] Fix | Delete
[1293] Fix | Delete
return (float) implode('.', $arrVer);
[1294] Fix | Delete
}
[1295] Fix | Delete
[1296] Fix | Delete
/**
[1297] Fix | Delete
* Check the version of the given property in the User-Agent.
[1298] Fix | Delete
* Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
[1299] Fix | Delete
*
[1300] Fix | Delete
* @param string $propertyName The name of the property. See self::getProperties() array
[1301] Fix | Delete
* keys for all possible properties.
[1302] Fix | Delete
* @param string $type Either self::VERSION_TYPE_STRING to get a string value or
[1303] Fix | Delete
* self::VERSION_TYPE_FLOAT indicating a float value. This parameter
[1304] Fix | Delete
* is optional and defaults to self::VERSION_TYPE_STRING. Passing an
[1305] Fix | Delete
* invalid parameter will default to the this type as well.
[1306] Fix | Delete
*
[1307] Fix | Delete
* @return string|float The version of the property we are trying to extract.
[1308] Fix | Delete
*/
[1309] Fix | Delete
public function version($propertyName, $type = self::VERSION_TYPE_STRING)
[1310] Fix | Delete
{
[1311] Fix | Delete
if (empty($propertyName)) {
[1312] Fix | Delete
return false;
[1313] Fix | Delete
}
[1314] Fix | Delete
[1315] Fix | Delete
// set the $type to the default if we don't recognize the type
[1316] Fix | Delete
if ($type !== self::VERSION_TYPE_STRING && $type !== self::VERSION_TYPE_FLOAT) {
[1317] Fix | Delete
$type = self::VERSION_TYPE_STRING;
[1318] Fix | Delete
}
[1319] Fix | Delete
[1320] Fix | Delete
$properties = self::getProperties();
[1321] Fix | Delete
[1322] Fix | Delete
// Check if the property exists in the properties array.
[1323] Fix | Delete
if (true === isset($properties[$propertyName])) {
[1324] Fix | Delete
[1325] Fix | Delete
// Prepare the pattern to be matched.
[1326] Fix | Delete
// Make sure we always deal with an array (string is converted).
[1327] Fix | Delete
$properties[$propertyName] = (array) $properties[$propertyName];
[1328] Fix | Delete
[1329] Fix | Delete
foreach ($properties[$propertyName] as $propertyMatchString) {
[1330] Fix | Delete
[1331] Fix | Delete
$propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString);
[1332] Fix | Delete
[1333] Fix | Delete
// Identify and extract the version.
[1334] Fix | Delete
preg_match(sprintf('#%s#is', $propertyPattern), $this->userAgent, $match);
[1335] Fix | Delete
[1336] Fix | Delete
if (false === empty($match[1])) {
[1337] Fix | Delete
$version = ($type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1]);
[1338] Fix | Delete
[1339] Fix | Delete
return $version;
[1340] Fix | Delete
}
[1341] Fix | Delete
[1342] Fix | Delete
}
[1343] Fix | Delete
[1344] Fix | Delete
}
[1345] Fix | Delete
[1346] Fix | Delete
return false;
[1347] Fix | Delete
}
[1348] Fix | Delete
[1349] Fix | Delete
/**
[1350] Fix | Delete
* Retrieve the mobile grading, using self::MOBILE_GRADE_* constants.
[1351] Fix | Delete
*
[1352] Fix | Delete
* @return string One of the self::MOBILE_GRADE_* constants.
[1353] Fix | Delete
*/
[1354] Fix | Delete
public function mobileGrade()
[1355] Fix | Delete
{
[1356] Fix | Delete
$isMobile = $this->isMobile();
[1357] Fix | Delete
[1358] Fix | Delete
if (
[1359] Fix | Delete
// Apple iOS 4-7.0 – Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3 / 5.1 / 6.1), iPad 3 (5.1 / 6.0), iPad Mini (6.1), iPad Retina (7.0), iPhone 3GS (4.3), iPhone 4 (4.3 / 5.1), iPhone 4S (5.1 / 6.0), iPhone 5 (6.0), and iPhone 5S (7.0)
[1360] Fix | Delete
$this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) >= 4.3 ||
[1361] Fix | Delete
$this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) >= 4.3 ||
[1362] Fix | Delete
$this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) >= 4.3 ||
[1363] Fix | Delete
[1364] Fix | Delete
// Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5)
[1365] Fix | Delete
// Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
[1366] Fix | Delete
// Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
[1367] Fix | Delete
// Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7
[1368] Fix | Delete
( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) ||
[1369] Fix | Delete
[1370] Fix | Delete
// Windows Phone 7.5-8 - Tested on the HTC Surround (7.5), HTC Trophy (7.5), LG-E900 (7.5), Nokia 800 (7.8), HTC Mazaa (7.8), Nokia Lumia 520 (8), Nokia Lumia 920 (8), HTC 8x (8)
[1371] Fix | Delete
$this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT) >= 7.5 ||
[1372] Fix | Delete
[1373] Fix | Delete
// Tested on the Torch 9800 (6) and Style 9670 (6), BlackBerry® Torch 9810 (7), BlackBerry Z10 (10)
[1374] Fix | Delete
$this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 6.0 ||
[1375] Fix | Delete
// Blackberry Playbook (1.0-2.0) - Tested on PlayBook
[1376] Fix | Delete
$this->match('Playbook.*Tablet') ||
[1377] Fix | Delete
[1378] Fix | Delete
// Palm WebOS (1.4-3.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0), HP TouchPad (3.0)
[1379] Fix | Delete
( $this->version('webOS', self::VERSION_TYPE_FLOAT) >= 1.4 && $this->match('Palm|Pre|Pixi') ) ||
[1380] Fix | Delete
// Palm WebOS 3.0 - Tested on HP TouchPad
[1381] Fix | Delete
$this->match('hp.*TouchPad') ||
[1382] Fix | Delete
[1383] Fix | Delete
// Firefox Mobile 18 - Tested on Android 2.3 and 4.1 devices
[1384] Fix | Delete
( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 18 ) ||
[1385] Fix | Delete
[1386] Fix | Delete
// Chrome for Android - Tested on Android 4.0, 4.1 device
[1387] Fix | Delete
( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 4.0 ) ||
[1388] Fix | Delete
[1389] Fix | Delete
// Skyfire 4.1 - Tested on Android 2.3 device
[1390] Fix | Delete
( $this->is('Skyfire') && $this->version('Skyfire', self::VERSION_TYPE_FLOAT) >= 4.1 && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) ||
[1391] Fix | Delete
[1392] Fix | Delete
// Opera Mobile 11.5-12: Tested on Android 2.3
[1393] Fix | Delete
( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11.5 && $this->is('AndroidOS') ) ||
[1394] Fix | Delete
[1395] Fix | Delete
// Meego 1.2 - Tested on Nokia 950 and N9
[1396] Fix | Delete
$this->is('MeeGoOS') ||
[1397] Fix | Delete
[1398] Fix | Delete
// Tizen (pre-release) - Tested on early hardware
[1399] Fix | Delete
$this->is('Tizen') ||
[1400] Fix | Delete
[1401] Fix | Delete
// Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
[1402] Fix | Delete
// @todo: more tests here!
[1403] Fix | Delete
$this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT) >= 2.0 ||
[1404] Fix | Delete
[1405] Fix | Delete
// UC Browser - Tested on Android 2.3 device
[1406] Fix | Delete
( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) ||
[1407] Fix | Delete
[1408] Fix | Delete
// Kindle 3 and Fire - Tested on the built-in WebKit browser for each
[1409] Fix | Delete
( $this->match('Kindle Fire') ||
[1410] Fix | Delete
$this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT) >= 3.0 ) ||
[1411] Fix | Delete
[1412] Fix | Delete
// Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
[1413] Fix | Delete
$this->is('AndroidOS') && $this->is('NookTablet') ||
[1414] Fix | Delete
[1415] Fix | Delete
// Chrome Desktop 16-24 - Tested on OS X 10.7 and Windows 7
[1416] Fix | Delete
$this->version('Chrome', self::VERSION_TYPE_FLOAT) >= 16 && !$isMobile ||
[1417] Fix | Delete
[1418] Fix | Delete
// Safari Desktop 5-6 - Tested on OS X 10.7 and Windows 7
[1419] Fix | Delete
$this->version('Safari', self::VERSION_TYPE_FLOAT) >= 5.0 && !$isMobile ||
[1420] Fix | Delete
[1421] Fix | Delete
// Firefox Desktop 10-18 - Tested on OS X 10.7 and Windows 7
[1422] Fix | Delete
$this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 10.0 && !$isMobile ||
[1423] Fix | Delete
[1424] Fix | Delete
// Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
[1425] Fix | Delete
$this->version('IE', self::VERSION_TYPE_FLOAT) >= 7.0 && !$isMobile ||
[1426] Fix | Delete
[1427] Fix | Delete
// Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7
[1428] Fix | Delete
$this->version('Opera', self::VERSION_TYPE_FLOAT) >= 10 && !$isMobile
[1429] Fix | Delete
){
[1430] Fix | Delete
return self::MOBILE_GRADE_A;
[1431] Fix | Delete
}
[1432] Fix | Delete
[1433] Fix | Delete
if (
[1434] Fix | Delete
$this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 ||
[1435] Fix | Delete
$this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<4.3 ||
[1436] Fix | Delete
$this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT)<4.3 ||
[1437] Fix | Delete
[1438] Fix | Delete
// Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
[1439] Fix | Delete
$this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 ||
[1440] Fix | Delete
[1441] Fix | Delete
//Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
[1442] Fix | Delete
($this->version('Opera Mini', self::VERSION_TYPE_FLOAT) >= 5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT) <= 7.0 &&
[1443] Fix | Delete
($this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 || $this->is('iOS')) ) ||
[1444] Fix | Delete
[1445] Fix | Delete
// Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)
[1446] Fix | Delete
$this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') ||
[1447] Fix | Delete
[1448] Fix | Delete
// @todo: report this (tested on Nokia N71)
[1449] Fix | Delete
$this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11 && $this->is('SymbianOS')
[1450] Fix | Delete
){
[1451] Fix | Delete
return self::MOBILE_GRADE_B;
[1452] Fix | Delete
}
[1453] Fix | Delete
[1454] Fix | Delete
if (
[1455] Fix | Delete
// Blackberry 4.x - Tested on the Curve 8330
[1456] Fix | Delete
$this->version('BlackBerry', self::VERSION_TYPE_FLOAT) <= 5.0 ||
[1457] Fix | Delete
// Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
[1458] Fix | Delete
$this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT) <= 5.2 ||
[1459] Fix | Delete
[1460] Fix | Delete
// Tested on original iPhone (3.1), iPhone 3 (3.2)
[1461] Fix | Delete
$this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) <= 3.2 ||
[1462] Fix | Delete
$this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) <= 3.2 ||
[1463] Fix | Delete
$this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) <= 3.2 ||
[1464] Fix | Delete
[1465] Fix | Delete
// Internet Explorer 7 and older - Tested on Windows XP
[1466] Fix | Delete
$this->version('IE', self::VERSION_TYPE_FLOAT) <= 7.0 && !$isMobile
[1467] Fix | Delete
){
[1468] Fix | Delete
return self::MOBILE_GRADE_C;
[1469] Fix | Delete
}
[1470] Fix | Delete
[1471] Fix | Delete
// All older smartphone platforms and featurephones - Any device that doesn't support media queries
[1472] Fix | Delete
// will receive the basic, C grade experience.
[1473] Fix | Delete
return self::MOBILE_GRADE_C;
[1474] Fix | Delete
}
[1475] Fix | Delete
}
[1476] Fix | Delete
[1477] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function