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
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/redux-fr.../redux-co.../inc/lib
File: browser.php
<?php /** @noinspection ALL */
[0] Fix | Delete
// phpcs:ignoreFile
[1] Fix | Delete
[2] Fix | Delete
/**
[3] Fix | Delete
* File: Browser.php
[4] Fix | Delete
* Author: Chris Schuld (http://chrisschuld.com/)
[5] Fix | Delete
* Last Modified: April 14th, 2020
[6] Fix | Delete
* @version 1.9.6
[7] Fix | Delete
*
[8] Fix | Delete
* Copyright 2019 Chris Schuld
[9] Fix | Delete
*
[10] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining a
[11] Fix | Delete
* copy of this software and associated documentation files (the "Software"),
[12] Fix | Delete
* to deal in the Software without restriction, including without
[13] Fix | Delete
* limitation the rights to use, copy, modify, merge, publish, distribute,
[14] Fix | Delete
* sublicense, and/or sell copies of the Software, and to permit persons to
[15] Fix | Delete
* whom the Software is furnished to do so, subject to the following
[16] Fix | Delete
* conditions:
[17] Fix | Delete
*
[18] Fix | Delete
* The above copyright notice and this permission notice shall be included
[19] Fix | Delete
* in all copies or substantial portions of the Software.
[20] Fix | Delete
*
[21] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
[22] Fix | Delete
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
[23] Fix | Delete
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
[24] Fix | Delete
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
[25] Fix | Delete
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
[26] Fix | Delete
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
[27] Fix | Delete
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[28] Fix | Delete
*
[29] Fix | Delete
* Typical Usage:
[30] Fix | Delete
*
[31] Fix | Delete
* $browser = new Browser();
[32] Fix | Delete
* if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
[33] Fix | Delete
* echo 'You have FireFox version 2 or greater';
[34] Fix | Delete
* }
[35] Fix | Delete
*
[36] Fix | Delete
* User Agents Sampled from: http://www.useragentstring.com/
[37] Fix | Delete
*
[38] Fix | Delete
* This implementation is based on the original work from Gary White
[39] Fix | Delete
* http://apptools.com/phptools/browser/
[40] Fix | Delete
*
[41] Fix | Delete
*/
[42] Fix | Delete
class ReduxBrowser {
[43] Fix | Delete
private $_agent = '';
[44] Fix | Delete
private $_browser_name = '';
[45] Fix | Delete
private $_version = '';
[46] Fix | Delete
private $_platform = '';
[47] Fix | Delete
private $_os = '';
[48] Fix | Delete
private $_is_aol = false;
[49] Fix | Delete
private $_is_mobile = false;
[50] Fix | Delete
private $_is_tablet = false;
[51] Fix | Delete
private $_is_robot = false;
[52] Fix | Delete
private $_is_facebook = false;
[53] Fix | Delete
private $_aol_version = '';
[54] Fix | Delete
[55] Fix | Delete
const BROWSER_UNKNOWN = 'unknown';
[56] Fix | Delete
const VERSION_UNKNOWN = 'unknown';
[57] Fix | Delete
[58] Fix | Delete
const BROWSER_OPERA = 'Opera'; // http://www.opera.com/
[59] Fix | Delete
const BROWSER_OPERA_MINI = 'Opera Mini'; // http://www.opera.com/mini/
[60] Fix | Delete
const BROWSER_WEBTV = 'WebTV'; // http://www.webtv.net/pc/
[61] Fix | Delete
const BROWSER_EDGE = 'Edge'; // https://www.microsoft.com/edge
[62] Fix | Delete
const BROWSER_IE = 'Internet Explorer'; // http://www.microsoft.com/ie/
[63] Fix | Delete
const BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // http://en.wikipedia.org/wiki/Internet_Explorer_Mobile
[64] Fix | Delete
const BROWSER_KONQUEROR = 'Konqueror'; // http://www.konqueror.org/
[65] Fix | Delete
const BROWSER_ICAB = 'iCab'; // http://www.icab.de/
[66] Fix | Delete
const BROWSER_OMNIWEB = 'OmniWeb'; // http://www.omnigroup.com/applications/omniweb/
[67] Fix | Delete
const BROWSER_FIREBIRD = 'Firebird'; // http://www.ibphoenix.com/
[68] Fix | Delete
const BROWSER_FIREFOX = 'Firefox'; // https://www.mozilla.org/en-US/firefox/
[69] Fix | Delete
const BROWSER_BRAVE = 'Brave'; // https://brave.com/
[70] Fix | Delete
const BROWSER_PALEMOON = 'Palemoon'; // https://www.palemoon.org/
[71] Fix | Delete
const BROWSER_ICEWEASEL = 'Iceweasel'; // http://www.geticeweasel.org/
[72] Fix | Delete
const BROWSER_SHIRETOKO = 'Shiretoko'; // http://wiki.mozilla.org/Projects/shiretoko
[73] Fix | Delete
const BROWSER_MOZILLA = 'Mozilla'; // http://www.mozilla.com/en-US/
[74] Fix | Delete
const BROWSER_AMAYA = 'Amaya'; // http://www.w3.org/Amaya/
[75] Fix | Delete
const BROWSER_LYNX = 'Lynx'; // http://en.wikipedia.org/wiki/Lynx
[76] Fix | Delete
const BROWSER_SAFARI = 'Safari'; // http://apple.com
[77] Fix | Delete
const BROWSER_IPHONE = 'iPhone'; // http://apple.com
[78] Fix | Delete
const BROWSER_IPOD = 'iPod'; // http://apple.com
[79] Fix | Delete
const BROWSER_IPAD = 'iPad'; // http://apple.com
[80] Fix | Delete
const BROWSER_CHROME = 'Chrome'; // http://www.google.com/chrome
[81] Fix | Delete
const BROWSER_ANDROID = 'Android'; // http://www.android.com/
[82] Fix | Delete
const BROWSER_GOOGLEBOT = 'GoogleBot'; // http://en.wikipedia.org/wiki/Googlebot
[83] Fix | Delete
const BROWSER_CURL = 'cURL'; // https://en.wikipedia.org/wiki/CURL
[84] Fix | Delete
const BROWSER_WGET = 'Wget'; // https://en.wikipedia.org/wiki/Wget
[85] Fix | Delete
const BROWSER_UCBROWSER = 'UCBrowser'; // https://www.ucweb.com/
[86] Fix | Delete
[87] Fix | Delete
[88] Fix | Delete
const BROWSER_YANDEXBOT = 'YandexBot'; // http://yandex.com/bots
[89] Fix | Delete
const BROWSER_YANDEXIMAGERESIZER_BOT = 'YandexImageResizer'; // http://yandex.com/bots
[90] Fix | Delete
const BROWSER_YANDEXIMAGES_BOT = 'YandexImages'; // http://yandex.com/bots
[91] Fix | Delete
const BROWSER_YANDEXVIDEO_BOT = 'YandexVideo'; // http://yandex.com/bots
[92] Fix | Delete
const BROWSER_YANDEXMEDIA_BOT = 'YandexMedia'; // http://yandex.com/bots
[93] Fix | Delete
const BROWSER_YANDEXBLOGS_BOT = 'YandexBlogs'; // http://yandex.com/bots
[94] Fix | Delete
const BROWSER_YANDEXFAVICONS_BOT = 'YandexFavicons'; // http://yandex.com/bots
[95] Fix | Delete
const BROWSER_YANDEXWEBMASTER_BOT = 'YandexWebmaster'; // http://yandex.com/bots
[96] Fix | Delete
const BROWSER_YANDEXDIRECT_BOT = 'YandexDirect'; // http://yandex.com/bots
[97] Fix | Delete
const BROWSER_YANDEXMETRIKA_BOT = 'YandexMetrika'; // http://yandex.com/bots
[98] Fix | Delete
const BROWSER_YANDEXNEWS_BOT = 'YandexNews'; // http://yandex.com/bots
[99] Fix | Delete
const BROWSER_YANDEXCATALOG_BOT = 'YandexCatalog'; // http://yandex.com/bots
[100] Fix | Delete
[101] Fix | Delete
const BROWSER_SLURP = 'Yahoo! Slurp'; // http://en.wikipedia.org/wiki/Yahoo!_Slurp
[102] Fix | Delete
const BROWSER_W3CVALIDATOR = 'W3C Validator'; // http://validator.w3.org/
[103] Fix | Delete
const BROWSER_BLACKBERRY = 'BlackBerry'; // http://www.blackberry.com/
[104] Fix | Delete
const BROWSER_ICECAT = 'IceCat'; // http://en.wikipedia.org/wiki/GNU_IceCat
[105] Fix | Delete
const BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // http://en.wikipedia.org/wiki/Web_Browser_for_S60
[106] Fix | Delete
const BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform
[107] Fix | Delete
const BROWSER_MSN = 'MSN Browser'; // http://explorer.msn.com/
[108] Fix | Delete
const BROWSER_MSNBOT = 'MSN Bot'; // http://search.msn.com/msnbot.htm
[109] Fix | Delete
const BROWSER_BINGBOT = 'Bing Bot'; // http://en.wikipedia.org/wiki/Bingbot
[110] Fix | Delete
const BROWSER_VIVALDI = 'Vivaldi'; // https://vivaldi.com/
[111] Fix | Delete
const BROWSER_YANDEX = 'Yandex'; // https://browser.yandex.ua/
[112] Fix | Delete
[113] Fix | Delete
const BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // http://browser.netscape.com/ (DEPRECATED)
[114] Fix | Delete
const BROWSER_GALEON = 'Galeon'; // http://galeon.sourceforge.net/ (DEPRECATED)
[115] Fix | Delete
const BROWSER_NETPOSITIVE = 'NetPositive'; // http://en.wikipedia.org/wiki/NetPositive (DEPRECATED)
[116] Fix | Delete
const BROWSER_PHOENIX = 'Phoenix'; // http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED)
[117] Fix | Delete
const BROWSER_PLAYSTATION = "PlayStation";
[118] Fix | Delete
const BROWSER_SAMSUNG = "SamsungBrowser";
[119] Fix | Delete
const BROWSER_SILK = "Silk";
[120] Fix | Delete
const BROWSER_I_FRAME = "Iframely";
[121] Fix | Delete
const BROWSER_COCOA = "CocoaRestClient";
[122] Fix | Delete
[123] Fix | Delete
const PLATFORM_UNKNOWN = 'unknown';
[124] Fix | Delete
const PLATFORM_WINDOWS = 'Windows';
[125] Fix | Delete
const PLATFORM_WINDOWS_CE = 'Windows CE';
[126] Fix | Delete
const PLATFORM_APPLE = 'Apple';
[127] Fix | Delete
const PLATFORM_LINUX = 'Linux';
[128] Fix | Delete
const PLATFORM_OS2 = 'OS/2';
[129] Fix | Delete
const PLATFORM_BEOS = 'BeOS';
[130] Fix | Delete
const PLATFORM_IPHONE = 'iPhone';
[131] Fix | Delete
const PLATFORM_IPOD = 'iPod';
[132] Fix | Delete
const PLATFORM_IPAD = 'iPad';
[133] Fix | Delete
const PLATFORM_BLACKBERRY = 'BlackBerry';
[134] Fix | Delete
const PLATFORM_NOKIA = 'Nokia';
[135] Fix | Delete
const PLATFORM_FREEBSD = 'FreeBSD';
[136] Fix | Delete
const PLATFORM_OPENBSD = 'OpenBSD';
[137] Fix | Delete
const PLATFORM_NETBSD = 'NetBSD';
[138] Fix | Delete
const PLATFORM_SUNOS = 'SunOS';
[139] Fix | Delete
const PLATFORM_OPENSOLARIS = 'OpenSolaris';
[140] Fix | Delete
const PLATFORM_ANDROID = 'Android';
[141] Fix | Delete
const PLATFORM_PLAYSTATION = "Sony PlayStation";
[142] Fix | Delete
const PLATFORM_ROKU = "Roku";
[143] Fix | Delete
const PLATFORM_APPLE_TV = "Apple TV";
[144] Fix | Delete
const PLATFORM_TERMINAL = "Terminal";
[145] Fix | Delete
const PLATFORM_FIRE_OS = "Fire OS";
[146] Fix | Delete
const PLATFORM_SMART_TV = "SMART-TV";
[147] Fix | Delete
const PLATFORM_CHROME_OS = "Chrome OS";
[148] Fix | Delete
const PLATFORM_JAVA_ANDROID = "Java/Android";
[149] Fix | Delete
const PLATFORM_POSTMAN = "Postman";
[150] Fix | Delete
const PLATFORM_I_FRAME = "Iframely";
[151] Fix | Delete
[152] Fix | Delete
const OPERATING_SYSTEM_UNKNOWN = 'unknown';
[153] Fix | Delete
[154] Fix | Delete
/**
[155] Fix | Delete
* Class constructor
[156] Fix | Delete
*
[157] Fix | Delete
* @param string $userAgent
[158] Fix | Delete
*/
[159] Fix | Delete
public function __construct( $userAgent = '' ) {
[160] Fix | Delete
if ( $userAgent != '' ) {
[161] Fix | Delete
$this->setUserAgent( $userAgent );
[162] Fix | Delete
} else {
[163] Fix | Delete
$this->reset();
[164] Fix | Delete
$this->determine();
[165] Fix | Delete
}
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
/**
[169] Fix | Delete
* Reset all properties
[170] Fix | Delete
*/
[171] Fix | Delete
public function reset() {
[172] Fix | Delete
$this->_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
[173] Fix | Delete
$this->_browser_name = self::BROWSER_UNKNOWN;
[174] Fix | Delete
$this->_version = self::VERSION_UNKNOWN;
[175] Fix | Delete
$this->_platform = self::PLATFORM_UNKNOWN;
[176] Fix | Delete
$this->_os = self::OPERATING_SYSTEM_UNKNOWN;
[177] Fix | Delete
$this->_is_aol = false;
[178] Fix | Delete
$this->_is_mobile = false;
[179] Fix | Delete
$this->_is_tablet = false;
[180] Fix | Delete
$this->_is_robot = false;
[181] Fix | Delete
$this->_is_facebook = false;
[182] Fix | Delete
$this->_aol_version = self::VERSION_UNKNOWN;
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
/**
[186] Fix | Delete
* Check to see if the specific browser is valid
[187] Fix | Delete
*
[188] Fix | Delete
* @param string $browserName
[189] Fix | Delete
*
[190] Fix | Delete
* @return bool True if the browser is the specified browser
[191] Fix | Delete
*/
[192] Fix | Delete
function isBrowser( $browserName ) {
[193] Fix | Delete
return ( 0 == strcasecmp( $this->_browser_name, trim( $browserName ) ) );
[194] Fix | Delete
}
[195] Fix | Delete
[196] Fix | Delete
/**
[197] Fix | Delete
* The name of the browser. All return types are from the class contants
[198] Fix | Delete
*
[199] Fix | Delete
* @return string Name of the browser
[200] Fix | Delete
*/
[201] Fix | Delete
public function getBrowser() {
[202] Fix | Delete
return $this->_browser_name;
[203] Fix | Delete
}
[204] Fix | Delete
[205] Fix | Delete
/**
[206] Fix | Delete
* Set the name of the browser
[207] Fix | Delete
*
[208] Fix | Delete
* @param $browser string The name of the Browser
[209] Fix | Delete
*/
[210] Fix | Delete
public function setBrowser( $browser ) {
[211] Fix | Delete
$this->_browser_name = $browser;
[212] Fix | Delete
}
[213] Fix | Delete
[214] Fix | Delete
/**
[215] Fix | Delete
* The name of the platform. All return types are from the class contants
[216] Fix | Delete
*
[217] Fix | Delete
* @return string Name of the browser
[218] Fix | Delete
*/
[219] Fix | Delete
public function getPlatform() {
[220] Fix | Delete
return $this->_platform;
[221] Fix | Delete
}
[222] Fix | Delete
[223] Fix | Delete
/**
[224] Fix | Delete
* Set the name of the platform
[225] Fix | Delete
*
[226] Fix | Delete
* @param string $platform The name of the Platform
[227] Fix | Delete
*/
[228] Fix | Delete
public function setPlatform( $platform ) {
[229] Fix | Delete
$this->_platform = $platform;
[230] Fix | Delete
}
[231] Fix | Delete
[232] Fix | Delete
/**
[233] Fix | Delete
* The version of the browser.
[234] Fix | Delete
*
[235] Fix | Delete
* @return string Version of the browser (will only contain alpha-numeric characters and a period)
[236] Fix | Delete
*/
[237] Fix | Delete
public function getVersion() {
[238] Fix | Delete
return $this->_version;
[239] Fix | Delete
}
[240] Fix | Delete
[241] Fix | Delete
/**
[242] Fix | Delete
* Set the version of the browser
[243] Fix | Delete
*
[244] Fix | Delete
* @param string $version The version of the Browser
[245] Fix | Delete
*/
[246] Fix | Delete
public function setVersion( $version ) {
[247] Fix | Delete
$this->_version = preg_replace( '/[^0-9,.,a-z,A-Z-]/', '', $version );
[248] Fix | Delete
}
[249] Fix | Delete
[250] Fix | Delete
/**
[251] Fix | Delete
* The version of AOL.
[252] Fix | Delete
*
[253] Fix | Delete
* @return string Version of AOL (will only contain alpha-numeric characters and a period)
[254] Fix | Delete
*/
[255] Fix | Delete
public function getAolVersion() {
[256] Fix | Delete
return $this->_aol_version;
[257] Fix | Delete
}
[258] Fix | Delete
[259] Fix | Delete
/**
[260] Fix | Delete
* Set the version of AOL
[261] Fix | Delete
*
[262] Fix | Delete
* @param string $version The version of AOL
[263] Fix | Delete
*/
[264] Fix | Delete
public function setAolVersion( $version ) {
[265] Fix | Delete
$this->_aol_version = preg_replace( '/[^0-9,.,a-z,A-Z]/', '', $version );
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
/**
[269] Fix | Delete
* Is the browser from AOL?
[270] Fix | Delete
*
[271] Fix | Delete
* @return boolean True if the browser is from AOL otherwise false
[272] Fix | Delete
*/
[273] Fix | Delete
public function isAol() {
[274] Fix | Delete
return $this->_is_aol;
[275] Fix | Delete
}
[276] Fix | Delete
[277] Fix | Delete
/**
[278] Fix | Delete
* Is the browser from a mobile device?
[279] Fix | Delete
*
[280] Fix | Delete
* @return boolean True if the browser is from a mobile device otherwise false
[281] Fix | Delete
*/
[282] Fix | Delete
public function isMobile() {
[283] Fix | Delete
return $this->_is_mobile;
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
/**
[287] Fix | Delete
* Is the browser from a tablet device?
[288] Fix | Delete
*
[289] Fix | Delete
* @return boolean True if the browser is from a tablet device otherwise false
[290] Fix | Delete
*/
[291] Fix | Delete
public function isTablet() {
[292] Fix | Delete
return $this->_is_tablet;
[293] Fix | Delete
}
[294] Fix | Delete
[295] Fix | Delete
/**
[296] Fix | Delete
* Is the browser from a robot (ex Slurp,GoogleBot)?
[297] Fix | Delete
*
[298] Fix | Delete
* @return boolean True if the browser is from a robot otherwise false
[299] Fix | Delete
*/
[300] Fix | Delete
public function isRobot() {
[301] Fix | Delete
return $this->_is_robot;
[302] Fix | Delete
}
[303] Fix | Delete
[304] Fix | Delete
/**
[305] Fix | Delete
* Is the browser from facebook?
[306] Fix | Delete
*
[307] Fix | Delete
* @return boolean True if the browser is from facebook otherwise false
[308] Fix | Delete
*/
[309] Fix | Delete
public function isFacebook() {
[310] Fix | Delete
return $this->_is_facebook;
[311] Fix | Delete
}
[312] Fix | Delete
[313] Fix | Delete
/**
[314] Fix | Delete
* Set the browser to be from AOL
[315] Fix | Delete
*
[316] Fix | Delete
* @param $isAol
[317] Fix | Delete
*/
[318] Fix | Delete
public function setAol( $isAol ) {
[319] Fix | Delete
$this->_is_aol = $isAol;
[320] Fix | Delete
}
[321] Fix | Delete
[322] Fix | Delete
/**
[323] Fix | Delete
* Set the Browser to be mobile
[324] Fix | Delete
*
[325] Fix | Delete
* @param boolean $value is the browser a mobile browser or not
[326] Fix | Delete
*/
[327] Fix | Delete
protected function setMobile( $value = true ) {
[328] Fix | Delete
$this->_is_mobile = $value;
[329] Fix | Delete
}
[330] Fix | Delete
[331] Fix | Delete
/**
[332] Fix | Delete
* Set the Browser to be tablet
[333] Fix | Delete
*
[334] Fix | Delete
* @param boolean $value is the browser a tablet browser or not
[335] Fix | Delete
*/
[336] Fix | Delete
protected function setTablet( $value = true ) {
[337] Fix | Delete
$this->_is_tablet = $value;
[338] Fix | Delete
}
[339] Fix | Delete
[340] Fix | Delete
/**
[341] Fix | Delete
* Set the Browser to be a robot
[342] Fix | Delete
*
[343] Fix | Delete
* @param boolean $value is the browser a robot or not
[344] Fix | Delete
*/
[345] Fix | Delete
protected function setRobot( $value = true ) {
[346] Fix | Delete
$this->_is_robot = $value;
[347] Fix | Delete
}
[348] Fix | Delete
[349] Fix | Delete
/**
[350] Fix | Delete
* Set the Browser to be a Facebook request
[351] Fix | Delete
*
[352] Fix | Delete
* @param boolean $value is the browser a robot or not
[353] Fix | Delete
*/
[354] Fix | Delete
protected function setFacebook( $value = true ) {
[355] Fix | Delete
$this->_is_facebook = $value;
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
/**
[359] Fix | Delete
* Get the user agent value in use to determine the browser
[360] Fix | Delete
*
[361] Fix | Delete
* @return string The user agent from the HTTP header
[362] Fix | Delete
*/
[363] Fix | Delete
public function getUserAgent() {
[364] Fix | Delete
return $this->_agent;
[365] Fix | Delete
}
[366] Fix | Delete
[367] Fix | Delete
/**
[368] Fix | Delete
* Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
[369] Fix | Delete
*
[370] Fix | Delete
* @param string $agent_string The value for the User Agent
[371] Fix | Delete
*/
[372] Fix | Delete
public function setUserAgent( $agent_string ) {
[373] Fix | Delete
$this->reset();
[374] Fix | Delete
$this->_agent = $agent_string;
[375] Fix | Delete
$this->determine();
[376] Fix | Delete
}
[377] Fix | Delete
[378] Fix | Delete
/**
[379] Fix | Delete
* Used to determine if the browser is actually "chromeframe"
[380] Fix | Delete
*
[381] Fix | Delete
* @return boolean True if the browser is using chromeframe
[382] Fix | Delete
* @since 1.7
[383] Fix | Delete
*/
[384] Fix | Delete
public function isChromeFrame() {
[385] Fix | Delete
return ( strpos( $this->_agent, "chromeframe" ) !== false );
[386] Fix | Delete
}
[387] Fix | Delete
[388] Fix | Delete
/**
[389] Fix | Delete
* Returns a formatted string with a summary of the details of the browser.
[390] Fix | Delete
*
[391] Fix | Delete
* @return string formatted string with a summary of the browser
[392] Fix | Delete
*/
[393] Fix | Delete
public function __toString() {
[394] Fix | Delete
return "<strong>Browser Name:</strong> {$this->getBrowser()}<br/>\n" .
[395] Fix | Delete
"<strong>Browser Version:</strong> {$this->getVersion()}<br/>\n" .
[396] Fix | Delete
"<strong>Browser User Agent String:</strong> {$this->getUserAgent()}<br/>\n" .
[397] Fix | Delete
"<strong>Platform:</strong> {$this->getPlatform()}<br/>";
[398] Fix | Delete
}
[399] Fix | Delete
[400] Fix | Delete
/**
[401] Fix | Delete
* Protected routine to calculate and determine what the browser is in use (including platform)
[402] Fix | Delete
*/
[403] Fix | Delete
protected function determine() {
[404] Fix | Delete
$this->checkPlatform();
[405] Fix | Delete
$this->checkBrowsers();
[406] Fix | Delete
$this->checkForAol();
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
/**
[410] Fix | Delete
* Protected routine to determine the browser type
[411] Fix | Delete
*
[412] Fix | Delete
* @return boolean True if the browser was detected otherwise false
[413] Fix | Delete
*/
[414] Fix | Delete
protected function checkBrowsers() {
[415] Fix | Delete
return (
[416] Fix | Delete
// well-known, well-used
[417] Fix | Delete
// Special Notes:
[418] Fix | Delete
// (1) Opera must be checked before FireFox due to the odd
[419] Fix | Delete
// user agents used in some older versions of Opera
[420] Fix | Delete
// (2) WebTV is strapped onto Internet Explorer so we must
[421] Fix | Delete
// check for WebTV before IE
[422] Fix | Delete
// (3) (deprecated) Galeon is based on Firefox and needs to be
[423] Fix | Delete
// tested before Firefox is tested
[424] Fix | Delete
// (4) OmniWeb is based on Safari so OmniWeb check must occur
[425] Fix | Delete
// before Safari
[426] Fix | Delete
// (5) Netscape 9+ is based on Firefox so Netscape checks
[427] Fix | Delete
// before FireFox are necessary
[428] Fix | Delete
// (6) Vivaldi is UA contains both Firefox and Chrome so Vivaldi checks
[429] Fix | Delete
// before Firefox and Chrome
[430] Fix | Delete
$this->checkBrowserWebTv() ||
[431] Fix | Delete
$this->checkBrowserBrave() ||
[432] Fix | Delete
$this->checkBrowserUCBrowser() ||
[433] Fix | Delete
$this->checkBrowserEdge() ||
[434] Fix | Delete
$this->checkBrowserInternetExplorer() ||
[435] Fix | Delete
$this->checkBrowserOpera() ||
[436] Fix | Delete
$this->checkBrowserGaleon() ||
[437] Fix | Delete
$this->checkBrowserNetscapeNavigator9Plus() ||
[438] Fix | Delete
$this->checkBrowserVivaldi() ||
[439] Fix | Delete
$this->checkBrowserYandex() ||
[440] Fix | Delete
$this->checkBrowserPalemoon() ||
[441] Fix | Delete
$this->checkBrowserFirefox() ||
[442] Fix | Delete
$this->checkBrowserChrome() ||
[443] Fix | Delete
$this->checkBrowserOmniWeb() ||
[444] Fix | Delete
[445] Fix | Delete
// common mobile
[446] Fix | Delete
$this->checkBrowserAndroid() ||
[447] Fix | Delete
$this->checkBrowseriPad() ||
[448] Fix | Delete
$this->checkBrowseriPod() ||
[449] Fix | Delete
$this->checkBrowseriPhone() ||
[450] Fix | Delete
$this->checkBrowserBlackBerry() ||
[451] Fix | Delete
$this->checkBrowserNokia() ||
[452] Fix | Delete
[453] Fix | Delete
// common bots
[454] Fix | Delete
$this->checkBrowserGoogleBot() ||
[455] Fix | Delete
$this->checkBrowserMSNBot() ||
[456] Fix | Delete
$this->checkBrowserBingBot() ||
[457] Fix | Delete
$this->checkBrowserSlurp() ||
[458] Fix | Delete
[459] Fix | Delete
// Yandex bots
[460] Fix | Delete
$this->checkBrowserYandexBot() ||
[461] Fix | Delete
$this->checkBrowserYandexImageResizerBot() ||
[462] Fix | Delete
$this->checkBrowserYandexBlogsBot() ||
[463] Fix | Delete
$this->checkBrowserYandexCatalogBot() ||
[464] Fix | Delete
$this->checkBrowserYandexDirectBot() ||
[465] Fix | Delete
$this->checkBrowserYandexFaviconsBot() ||
[466] Fix | Delete
$this->checkBrowserYandexImagesBot() ||
[467] Fix | Delete
$this->checkBrowserYandexMediaBot() ||
[468] Fix | Delete
$this->checkBrowserYandexMetrikaBot() ||
[469] Fix | Delete
$this->checkBrowserYandexNewsBot() ||
[470] Fix | Delete
$this->checkBrowserYandexVideoBot() ||
[471] Fix | Delete
$this->checkBrowserYandexWebmasterBot() ||
[472] Fix | Delete
[473] Fix | Delete
// check for facebook external hit when loading URL
[474] Fix | Delete
$this->checkFacebookExternalHit() ||
[475] Fix | Delete
[476] Fix | Delete
// WebKit base check (post mobile and others)
[477] Fix | Delete
$this->checkBrowserSamsung() ||
[478] Fix | Delete
$this->checkBrowserSilk() ||
[479] Fix | Delete
$this->checkBrowserSafari() ||
[480] Fix | Delete
[481] Fix | Delete
// everyone else
[482] Fix | Delete
$this->checkBrowserNetPositive() ||
[483] Fix | Delete
$this->checkBrowserFirebird() ||
[484] Fix | Delete
$this->checkBrowserKonqueror() ||
[485] Fix | Delete
$this->checkBrowserIcab() ||
[486] Fix | Delete
$this->checkBrowserPhoenix() ||
[487] Fix | Delete
$this->checkBrowserAmaya() ||
[488] Fix | Delete
$this->checkBrowserLynx() ||
[489] Fix | Delete
$this->checkBrowserShiretoko() ||
[490] Fix | Delete
$this->checkBrowserIceCat() ||
[491] Fix | Delete
$this->checkBrowserIceweasel() ||
[492] Fix | Delete
$this->checkBrowserW3CValidator() ||
[493] Fix | Delete
$this->checkBrowserCurl() ||
[494] Fix | Delete
$this->checkBrowserWget() ||
[495] Fix | Delete
$this->checkBrowserPlayStation() ||
[496] Fix | Delete
$this->checkBrowserIframely() ||
[497] Fix | Delete
$this->checkBrowserCocoa() ||
[498] Fix | Delete
$this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */ );
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function