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/wp-conte.../plugins/sitepres.../lib
File: mobile-detect.php
$this->setDetectionType('mobile');
[500] Fix | Delete
[501] Fix | Delete
foreach($this->tabletDevices as $_regex){
[502] Fix | Delete
if($this->match($_regex, $userAgent)){
[503] Fix | Delete
return true;
[504] Fix | Delete
}
[505] Fix | Delete
}
[506] Fix | Delete
[507] Fix | Delete
return false;
[508] Fix | Delete
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
/**
[512] Fix | Delete
* This method checks for a certain property in the
[513] Fix | Delete
* userAgent.
[514] Fix | Delete
* @todo: The httpHeaders part is not yet used.
[515] Fix | Delete
*
[516] Fix | Delete
* @param $key
[517] Fix | Delete
* @param string $userAgent deprecated
[518] Fix | Delete
* @param string $httpHeaders deprecated
[519] Fix | Delete
* @return bool|int|null
[520] Fix | Delete
*/
[521] Fix | Delete
public function is($key, $userAgent = null, $httpHeaders = null){
[522] Fix | Delete
[523] Fix | Delete
[524] Fix | Delete
// Set the UA and HTTP headers only if needed (eg. batch mode).
[525] Fix | Delete
if($httpHeaders) $this->setHttpHeaders($httpHeaders);
[526] Fix | Delete
if($userAgent) $this->setUserAgent($userAgent);
[527] Fix | Delete
[528] Fix | Delete
$this->setDetectionType('extended');
[529] Fix | Delete
[530] Fix | Delete
return $this->matchUAAgainstKey($key);
[531] Fix | Delete
[532] Fix | Delete
}
[533] Fix | Delete
[534] Fix | Delete
public function getOperatingSystems(){
[535] Fix | Delete
[536] Fix | Delete
return $this->operatingSystems;
[537] Fix | Delete
[538] Fix | Delete
}
[539] Fix | Delete
[540] Fix | Delete
/**
[541] Fix | Delete
* Some detection rules are relative (not standard),
[542] Fix | Delete
* because of the diversity of devices, vendors and
[543] Fix | Delete
* their conventions in representing the User-Agent or
[544] Fix | Delete
* the HTTP headers.
[545] Fix | Delete
*
[546] Fix | Delete
* This method will be used to check custom regexes against
[547] Fix | Delete
* the User-Agent string.
[548] Fix | Delete
*
[549] Fix | Delete
* @param $regex
[550] Fix | Delete
* @param string $userAgent
[551] Fix | Delete
* @return bool
[552] Fix | Delete
*
[553] Fix | Delete
* @todo: search in the HTTP headers too.
[554] Fix | Delete
*/
[555] Fix | Delete
function match($regex, $userAgent=null){
[556] Fix | Delete
[557] Fix | Delete
// Escape the special character which is the delimiter.
[558] Fix | Delete
$regex = str_replace('/', '\/', $regex);
[559] Fix | Delete
[560] Fix | Delete
return (bool)preg_match('/'.$regex.'/is', (!empty($userAgent) ? $userAgent : $this->userAgent));
[561] Fix | Delete
[562] Fix | Delete
}
[563] Fix | Delete
[564] Fix | Delete
/**
[565] Fix | Delete
* Get the properties array.
[566] Fix | Delete
* @return array
[567] Fix | Delete
*/
[568] Fix | Delete
function getProperties(){
[569] Fix | Delete
[570] Fix | Delete
return $this->properties;
[571] Fix | Delete
[572] Fix | Delete
}
[573] Fix | Delete
[574] Fix | Delete
/**
[575] Fix | Delete
* Prepare the version number.
[576] Fix | Delete
*
[577] Fix | Delete
* @param $ver
[578] Fix | Delete
* @return int
[579] Fix | Delete
*/
[580] Fix | Delete
function prepareVersionNo($ver){
[581] Fix | Delete
[582] Fix | Delete
$ver = str_replace(array('_', ' ', '/'), array('.', '.', '.'), $ver);
[583] Fix | Delete
$arrVer = explode('.', $ver, 2);
[584] Fix | Delete
$arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions.
[585] Fix | Delete
$ver = (float)implode('.', $arrVer);
[586] Fix | Delete
[587] Fix | Delete
return $ver;
[588] Fix | Delete
[589] Fix | Delete
}
[590] Fix | Delete
[591] Fix | Delete
/**
[592] Fix | Delete
* Check the version of the given property in the User-Agent.
[593] Fix | Delete
* Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
[594] Fix | Delete
*
[595] Fix | Delete
* @param string $propertyName
[596] Fix | Delete
* @return mixed $version
[597] Fix | Delete
*/
[598] Fix | Delete
function version($propertyName){
[599] Fix | Delete
[600] Fix | Delete
$properties = $this->getProperties();
[601] Fix | Delete
[602] Fix | Delete
// If the property is found in the User-Agent then move to the next step.
[603] Fix | Delete
if(stripos($this->userAgent, $propertyName)!==false){
[604] Fix | Delete
[605] Fix | Delete
// Prepare the pattern to be matched.
[606] Fix | Delete
// Make sure we always deal with an array (string is converted).
[607] Fix | Delete
$properties[$propertyName] = (array)$properties[$propertyName];
[608] Fix | Delete
[609] Fix | Delete
foreach($properties[$propertyName] as $propertyMatchString){
[610] Fix | Delete
[611] Fix | Delete
$propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString);
[612] Fix | Delete
[613] Fix | Delete
// Escape the special character which is the delimiter.
[614] Fix | Delete
$propertyPattern = str_replace('/', '\/', $propertyPattern);
[615] Fix | Delete
[616] Fix | Delete
// Identify and extract the version.
[617] Fix | Delete
preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match);
[618] Fix | Delete
[619] Fix | Delete
if(!empty($match[1])){
[620] Fix | Delete
$version = $this->prepareVersionNo($match[1]);
[621] Fix | Delete
return $version;
[622] Fix | Delete
}
[623] Fix | Delete
[624] Fix | Delete
}
[625] Fix | Delete
[626] Fix | Delete
return 0;
[627] Fix | Delete
[628] Fix | Delete
}
[629] Fix | Delete
[630] Fix | Delete
return false;
[631] Fix | Delete
[632] Fix | Delete
}
[633] Fix | Delete
[634] Fix | Delete
function mobileGrade(){
[635] Fix | Delete
[636] Fix | Delete
$isMobile = $this->isMobile();
[637] Fix | Delete
[638] Fix | Delete
if(
[639] Fix | Delete
// Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1)
[640] Fix | Delete
$this->version('iPad')>=4.3 ||
[641] Fix | Delete
$this->version('iPhone')>=3.1 ||
[642] Fix | Delete
$this->version('iPod')>=3.1 ||
[643] Fix | Delete
[644] 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)
[645] Fix | Delete
// Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
[646] Fix | Delete
// Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
[647] Fix | Delete
// Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7
[648] Fix | Delete
( $this->version('Android')>2.1 && $this->is('Webkit') ) ||
[649] Fix | Delete
[650] Fix | Delete
// Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800
[651] Fix | Delete
$this->version('Windows Phone OS')>=7.0 ||
[652] Fix | Delete
[653] Fix | Delete
// Blackberry 7 - Tested on BlackBerry® Torch 9810
[654] Fix | Delete
// Blackberry 6.0 - Tested on the Torch 9800 and Style 9670
[655] Fix | Delete
$this->version('BlackBerry')>=6.0 ||
[656] Fix | Delete
// Blackberry Playbook (1.0-2.0) - Tested on PlayBook
[657] Fix | Delete
$this->match('Playbook.*Tablet') ||
[658] Fix | Delete
[659] Fix | Delete
// Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0)
[660] Fix | Delete
( $this->version('webOS')>=1.4 && $this->match('Palm|Pre|Pixi') ) ||
[661] Fix | Delete
// Palm WebOS 3.0 - Tested on HP TouchPad
[662] Fix | Delete
$this->match('hp.*TouchPad') ||
[663] Fix | Delete
[664] Fix | Delete
// Firefox Mobile (12 Beta) - Tested on Android 2.3 device
[665] Fix | Delete
( $this->is('Firefox') && $this->version('Firefox')>=12 ) ||
[666] Fix | Delete
[667] Fix | Delete
// Chrome for Android - Tested on Android 4.0, 4.1 device
[668] Fix | Delete
( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android')>=4.0 ) ||
[669] Fix | Delete
[670] Fix | Delete
// Skyfire 4.1 - Tested on Android 2.3 device
[671] Fix | Delete
( $this->is('Skyfire') && $this->version('Skyfire')>=4.1 && $this->is('AndroidOS') && $this->version('Android')>=2.3 ) ||
[672] Fix | Delete
[673] Fix | Delete
// Opera Mobile 11.5-12: Tested on Android 2.3
[674] Fix | Delete
( $this->is('Opera') && $this->version('Opera Mobi')>11 && $this->is('AndroidOS') ) ||
[675] Fix | Delete
[676] Fix | Delete
// Meego 1.2 - Tested on Nokia 950 and N9
[677] Fix | Delete
$this->is('MeeGoOS') ||
[678] Fix | Delete
[679] Fix | Delete
// Tizen (pre-release) - Tested on early hardware
[680] Fix | Delete
$this->is('Tizen') ||
[681] Fix | Delete
[682] Fix | Delete
// Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
[683] Fix | Delete
// @todo: more tests here!
[684] Fix | Delete
$this->is('Dolfin') && $this->version('Bada')>=2.0 ||
[685] Fix | Delete
[686] Fix | Delete
// UC Browser - Tested on Android 2.3 device
[687] Fix | Delete
( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android')>=2.3 ) ||
[688] Fix | Delete
[689] Fix | Delete
// Kindle 3 and Fire - Tested on the built-in WebKit browser for each
[690] Fix | Delete
( $this->match('Kindle Fire') ||
[691] Fix | Delete
$this->is('Kindle') && $this->version('Kindle')>=3.0 ) ||
[692] Fix | Delete
[693] Fix | Delete
// Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
[694] Fix | Delete
$this->is('AndroidOS') && $this->is('NookTablet') ||
[695] Fix | Delete
[696] Fix | Delete
// Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7
[697] Fix | Delete
$this->version('Chrome')>=11 && !$isMobile ||
[698] Fix | Delete
[699] Fix | Delete
// Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7
[700] Fix | Delete
$this->version('Safari')>=5.0 && !$isMobile ||
[701] Fix | Delete
[702] Fix | Delete
// Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7
[703] Fix | Delete
$this->version('Firefox')>=4.0 && !$isMobile ||
[704] Fix | Delete
[705] Fix | Delete
// Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
[706] Fix | Delete
$this->version('MSIE')>=7.0 && !$isMobile ||
[707] Fix | Delete
[708] Fix | Delete
// Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7
[709] Fix | Delete
// @reference: http://my.opera.com/community/openweb/idopera/
[710] Fix | Delete
$this->version('Opera')>=10 && !$isMobile
[711] Fix | Delete
[712] Fix | Delete
[713] Fix | Delete
){
[714] Fix | Delete
return 'A';
[715] Fix | Delete
}
[716] Fix | Delete
[717] Fix | Delete
if(
[718] Fix | Delete
// Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
[719] Fix | Delete
$this->version('BlackBerry')>=5 && $this->version('BlackBerry')<6 ||
[720] Fix | Delete
[721] Fix | Delete
//Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
[722] Fix | Delete
( $this->version('Opera Mini')>=5.0 && $this->version('Opera Mini')<=6.5 &&
[723] Fix | Delete
($this->version('Android')>=2.3 || $this->is('iOS')) ) ||
[724] Fix | Delete
[725] Fix | Delete
// Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)
[726] Fix | Delete
$this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') ||
[727] Fix | Delete
[728] Fix | Delete
// @todo: report this (tested on Nokia N71)
[729] Fix | Delete
$this->version('Opera Mobi')>=11 && $this->is('SymbianOS')
[730] Fix | Delete
[731] Fix | Delete
){
[732] Fix | Delete
return 'B';
[733] Fix | Delete
}
[734] Fix | Delete
[735] Fix | Delete
if(
[736] Fix | Delete
// Blackberry 4.x - Tested on the Curve 8330
[737] Fix | Delete
$this->version('BlackBerry')<5.0 ||
[738] Fix | Delete
// Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
[739] Fix | Delete
$this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile')<=5.2
[740] Fix | Delete
[741] Fix | Delete
[742] Fix | Delete
){
[743] Fix | Delete
[744] Fix | Delete
return 'C';
[745] Fix | Delete
[746] Fix | Delete
}
[747] Fix | Delete
[748] Fix | Delete
// All older smartphone platforms and featurephones - Any device that doesn't support media queries will receive the basic, C grade experience
[749] Fix | Delete
return 'C';
[750] Fix | Delete
[751] Fix | Delete
[752] Fix | Delete
}
[753] Fix | Delete
[754] Fix | Delete
[755] Fix | Delete
}
[756] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function