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/advanced.../lib/mobilede.../mobilede...
File: Mobile_Detect.php
}
[1500] Fix | Delete
[1501] Fix | Delete
return (float) implode('.', $arrVer);
[1502] Fix | Delete
}
[1503] Fix | Delete
[1504] Fix | Delete
/**
[1505] Fix | Delete
* Check the version of the given property in the User-Agent.
[1506] Fix | Delete
* Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
[1507] Fix | Delete
*
[1508] Fix | Delete
* @param string $propertyName The name of the property. See self::getProperties() array
[1509] Fix | Delete
* keys for all possible properties.
[1510] Fix | Delete
* @param string $type Either self::VERSION_TYPE_STRING to get a string value or
[1511] Fix | Delete
* self::VERSION_TYPE_FLOAT indicating a float value. This parameter
[1512] Fix | Delete
* is optional and defaults to self::VERSION_TYPE_STRING. Passing an
[1513] Fix | Delete
* invalid parameter will default to the this type as well.
[1514] Fix | Delete
*
[1515] Fix | Delete
* @return string|float|false The version of the property we are trying to extract.
[1516] Fix | Delete
*/
[1517] Fix | Delete
public function version($propertyName, $type = self::VERSION_TYPE_STRING)
[1518] Fix | Delete
{
[1519] Fix | Delete
if (empty($propertyName)) {
[1520] Fix | Delete
return false;
[1521] Fix | Delete
}
[1522] Fix | Delete
[1523] Fix | Delete
if (!\is_string($this->userAgent)) {
[1524] Fix | Delete
return false;
[1525] Fix | Delete
}
[1526] Fix | Delete
[1527] Fix | Delete
// set the $type to the default if we don't recognize the type
[1528] Fix | Delete
if ($type !== self::VERSION_TYPE_STRING && $type !== self::VERSION_TYPE_FLOAT) {
[1529] Fix | Delete
$type = self::VERSION_TYPE_STRING;
[1530] Fix | Delete
}
[1531] Fix | Delete
[1532] Fix | Delete
$properties = self::getProperties();
[1533] Fix | Delete
[1534] Fix | Delete
// Check if the property exists in the properties array.
[1535] Fix | Delete
if (true === isset($properties[$propertyName])) {
[1536] Fix | Delete
[1537] Fix | Delete
// Prepare the pattern to be matched.
[1538] Fix | Delete
// Make sure we always deal with an array (string is converted).
[1539] Fix | Delete
$properties[$propertyName] = (array) $properties[$propertyName];
[1540] Fix | Delete
[1541] Fix | Delete
foreach ($properties[$propertyName] as $propertyMatchString) {
[1542] Fix | Delete
[1543] Fix | Delete
$propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString);
[1544] Fix | Delete
[1545] Fix | Delete
// Identify and extract the version.
[1546] Fix | Delete
preg_match(sprintf('#%s#is', $propertyPattern), $this->userAgent, $match);
[1547] Fix | Delete
[1548] Fix | Delete
if (false === empty($match[1])) {
[1549] Fix | Delete
$version = ($type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1]);
[1550] Fix | Delete
[1551] Fix | Delete
return $version;
[1552] Fix | Delete
}
[1553] Fix | Delete
[1554] Fix | Delete
}
[1555] Fix | Delete
[1556] Fix | Delete
}
[1557] Fix | Delete
[1558] Fix | Delete
return false;
[1559] Fix | Delete
}
[1560] Fix | Delete
[1561] Fix | Delete
/**
[1562] Fix | Delete
* Retrieve the mobile grading, using self::MOBILE_GRADE_* constants.
[1563] Fix | Delete
* @deprecated This is no longer being maintained, it was an experiment at the time.
[1564] Fix | Delete
* @return string One of the self::MOBILE_GRADE_* constants.
[1565] Fix | Delete
*/
[1566] Fix | Delete
public function mobileGrade()
[1567] Fix | Delete
{
[1568] Fix | Delete
$isMobile = $this->isMobile();
[1569] Fix | Delete
[1570] Fix | Delete
if (
[1571] 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)
[1572] Fix | Delete
$this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) >= 4.3 ||
[1573] Fix | Delete
$this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) >= 4.3 ||
[1574] Fix | Delete
$this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) >= 4.3 ||
[1575] Fix | Delete
[1576] 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)
[1577] Fix | Delete
// Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
[1578] Fix | Delete
// Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
[1579] Fix | Delete
// Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7
[1580] Fix | Delete
( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) ||
[1581] Fix | Delete
[1582] 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)
[1583] Fix | Delete
$this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT) >= 7.5 ||
[1584] Fix | Delete
[1585] Fix | Delete
// Tested on the Torch 9800 (6) and Style 9670 (6), BlackBerry® Torch 9810 (7), BlackBerry Z10 (10)
[1586] Fix | Delete
$this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 6.0 ||
[1587] Fix | Delete
// Blackberry Playbook (1.0-2.0) - Tested on PlayBook
[1588] Fix | Delete
$this->match('Playbook.*Tablet') ||
[1589] Fix | Delete
[1590] 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)
[1591] Fix | Delete
( $this->version('webOS', self::VERSION_TYPE_FLOAT) >= 1.4 && $this->match('Palm|Pre|Pixi') ) ||
[1592] Fix | Delete
// Palm WebOS 3.0 - Tested on HP TouchPad
[1593] Fix | Delete
$this->match('hp.*TouchPad') ||
[1594] Fix | Delete
[1595] Fix | Delete
// Firefox Mobile 18 - Tested on Android 2.3 and 4.1 devices
[1596] Fix | Delete
( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 18 ) ||
[1597] Fix | Delete
[1598] Fix | Delete
// Chrome for Android - Tested on Android 4.0, 4.1 device
[1599] Fix | Delete
( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 4.0 ) ||
[1600] Fix | Delete
[1601] Fix | Delete
// Skyfire 4.1 - Tested on Android 2.3 device
[1602] 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 ) ||
[1603] Fix | Delete
[1604] Fix | Delete
// Opera Mobile 11.5-12: Tested on Android 2.3
[1605] Fix | Delete
( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11.5 && $this->is('AndroidOS') ) ||
[1606] Fix | Delete
[1607] Fix | Delete
// Meego 1.2 - Tested on Nokia 950 and N9
[1608] Fix | Delete
$this->is('MeeGoOS') ||
[1609] Fix | Delete
[1610] Fix | Delete
// Sailfish OS
[1611] Fix | Delete
$this->is('SailfishOS') ||
[1612] Fix | Delete
[1613] Fix | Delete
// Tizen (pre-release) - Tested on early hardware
[1614] Fix | Delete
$this->is('Tizen') ||
[1615] Fix | Delete
[1616] Fix | Delete
// Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
[1617] Fix | Delete
// @todo: more tests here!
[1618] Fix | Delete
$this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT) >= 2.0 ||
[1619] Fix | Delete
[1620] Fix | Delete
// UC Browser - Tested on Android 2.3 device
[1621] Fix | Delete
( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) ||
[1622] Fix | Delete
[1623] Fix | Delete
// Kindle 3 and Fire - Tested on the built-in WebKit browser for each
[1624] Fix | Delete
( $this->match('Kindle Fire') ||
[1625] Fix | Delete
$this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT) >= 3.0 ) ||
[1626] Fix | Delete
[1627] Fix | Delete
// Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
[1628] Fix | Delete
$this->is('AndroidOS') && $this->is('NookTablet') ||
[1629] Fix | Delete
[1630] Fix | Delete
// Chrome Desktop 16-24 - Tested on OS X 10.7 and Windows 7
[1631] Fix | Delete
$this->version('Chrome', self::VERSION_TYPE_FLOAT) >= 16 && !$isMobile ||
[1632] Fix | Delete
[1633] Fix | Delete
// Safari Desktop 5-6 - Tested on OS X 10.7 and Windows 7
[1634] Fix | Delete
$this->version('Safari', self::VERSION_TYPE_FLOAT) >= 5.0 && !$isMobile ||
[1635] Fix | Delete
[1636] Fix | Delete
// Firefox Desktop 10-18 - Tested on OS X 10.7 and Windows 7
[1637] Fix | Delete
$this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 10.0 && !$isMobile ||
[1638] Fix | Delete
[1639] Fix | Delete
// Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
[1640] Fix | Delete
$this->version('IE', self::VERSION_TYPE_FLOAT) >= 7.0 && !$isMobile ||
[1641] Fix | Delete
[1642] Fix | Delete
// Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7
[1643] Fix | Delete
$this->version('Opera', self::VERSION_TYPE_FLOAT) >= 10 && !$isMobile
[1644] Fix | Delete
){
[1645] Fix | Delete
return self::MOBILE_GRADE_A;
[1646] Fix | Delete
}
[1647] Fix | Delete
[1648] Fix | Delete
if (
[1649] Fix | Delete
$this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 ||
[1650] Fix | Delete
$this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<4.3 ||
[1651] Fix | Delete
$this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT)<4.3 ||
[1652] Fix | Delete
[1653] Fix | Delete
// Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
[1654] Fix | Delete
$this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 ||
[1655] Fix | Delete
[1656] Fix | Delete
//Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
[1657] Fix | Delete
($this->version('Opera Mini', self::VERSION_TYPE_FLOAT) >= 5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT) <= 7.0 &&
[1658] Fix | Delete
($this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 || $this->is('iOS')) ) ||
[1659] Fix | Delete
[1660] Fix | Delete
// Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)
[1661] Fix | Delete
$this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') ||
[1662] Fix | Delete
[1663] Fix | Delete
// @todo: report this (tested on Nokia N71)
[1664] Fix | Delete
$this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11 && $this->is('SymbianOS')
[1665] Fix | Delete
){
[1666] Fix | Delete
return self::MOBILE_GRADE_B;
[1667] Fix | Delete
}
[1668] Fix | Delete
[1669] Fix | Delete
if (
[1670] Fix | Delete
// Blackberry 4.x - Tested on the Curve 8330
[1671] Fix | Delete
$this->version('BlackBerry', self::VERSION_TYPE_FLOAT) <= 5.0 ||
[1672] Fix | Delete
// Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
[1673] Fix | Delete
$this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT) <= 5.2 ||
[1674] Fix | Delete
[1675] Fix | Delete
// Tested on original iPhone (3.1), iPhone 3 (3.2)
[1676] Fix | Delete
$this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) <= 3.2 ||
[1677] Fix | Delete
$this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) <= 3.2 ||
[1678] Fix | Delete
$this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) <= 3.2 ||
[1679] Fix | Delete
[1680] Fix | Delete
// Internet Explorer 7 and older - Tested on Windows XP
[1681] Fix | Delete
$this->version('IE', self::VERSION_TYPE_FLOAT) <= 7.0 && !$isMobile
[1682] Fix | Delete
){
[1683] Fix | Delete
return self::MOBILE_GRADE_C;
[1684] Fix | Delete
}
[1685] Fix | Delete
[1686] Fix | Delete
// All older smartphone platforms and featurephones - Any device that doesn't support media queries
[1687] Fix | Delete
// will receive the basic, C grade experience.
[1688] Fix | Delete
return self::MOBILE_GRADE_C;
[1689] Fix | Delete
}
[1690] Fix | Delete
}
[1691] Fix | Delete
[1692] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function