PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / trunk
GiveWP – Donation Plugin and Fundraising Platform vtrunk
4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / libraries / browser.php
give / includes / libraries Last commit date
googlechartlib 8 years ago array2xml.php 8 years ago browser.php 9 months ago give-pdf.php 6 years ago
browser.php
1182 lines
1 <?php
2 /**
3 * Modified to remove var
4 * Chris Christoff on 12/26/2012
5 * Changes: Changes vars to publics
6 *
7 * Modified to work for EDD by
8 * Chris Christoff on 12/23/2012
9 * Changes: Removed the browser string return and added spacing. Also removed return HTML formatting.
10 *
11 * Modified to add formatted User Agent string for EDD System Info by
12 * Chris Christoff on 12/23/2012
13 * Changes: Split user string and add formatting so we can print a nicely
14 * formatted user agent string on the EDD System Info
15 *
16 * File: Browser.php
17 * Author: Chris Schuld (http://chrisschuld.com/)
18 * Last Modified: August 20th, 2010
19 * @version 2.0
20 * @package PegasusPHP
21 *
22 * Copyright (C) 2008-2010 Chris Schuld (chris@chrisschuld.com)
23 *
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU General Public License as
26 * published by the Free Software Foundation; either version 2 of
27 * the License, or (at your option) any later version.
28 *
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details at:
33 * http://www.gnu.org/copyleft/gpl.html
34 *
35 *
36 * Typical Usage:
37 *
38 * $browser = new Browser();
39 * if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
40 * echo 'You have FireFox version 2 or greater';
41 * }
42 *
43 * User Agents Sampled from: http://www.useragentstring.com/
44 *
45 * This implementation is based on the original work from Gary White
46 * http://apptools.com/phptools/browser/
47 *
48 * UPDATES:
49 *
50 * 2010-08-20 (v2.0):
51 * + Added MSN Explorer Browser (legacy)
52 * + Added Bing/MSN Robot (Thanks Rob MacDonald)
53 * + Added the Android Platform (PLATFORM_ANDROID)
54 * + Fixed issue with Android 1.6/2.2 (Thanks Tom Hirashima)
55 *
56 * 2010-04-27 (v1.8):
57 * + Added iPad Support
58 *
59 * 2010-03-07 (v1.7):
60 * + *MAJOR* Rebuild (preg_match and other "slow" routine removal(s))
61 * + Almost allof Gary's original code has been replaced
62 * + Large PHPUNIT testing environment created to validate new releases and additions
63 * + Added FreeBSD Platform
64 * + Added OpenBSD Platform
65 * + Added NetBSD Platform
66 * + Added SunOS Platform
67 * + Added OpenSolaris Platform
68 * + Added support of the Iceweazel Browser
69 * + Added isChromeFrame() call to check if chromeframe is in use
70 * + Moved the Opera check in front of the Firefox check due to legacy Opera User Agents
71 * + Added the __toString() method (Thanks Deano)
72 *
73 * 2009-11-15:
74 * + Updated the checkes for Firefox
75 * + Added the NOKIA platform
76 * + Added Checks for the NOKIA brower(s)
77 *
78 * 2009-11-08:
79 * + PHP 5.3 Support
80 * + Added support for BlackBerry OS and BlackBerry browser
81 * + Added support for the Opera Mini browser
82 * + Added additional documenation
83 * + Added support for isRobot() and isMobile()
84 * + Added support for Opera version 10
85 * + Added support for deprecated Netscape Navigator version 9
86 * + Added support for IceCat
87 * + Added support for Shiretoko
88 *
89 * 2010-04-27 (v1.8):
90 * + Added iPad Support
91 *
92 * 2009-08-18:
93 * + Updated to support PHP 5.3 - removed all deprecated function calls
94 * + Updated to remove all double quotes (") -- converted to single quotes (')
95 *
96 * 2009-04-27:
97 * + Updated the IE check to remove a typo and bug (thanks John)
98 *
99 * 2009-04-22:
100 * + Added detection for GoogleBot
101 * + Added detection for the W3C Validator.
102 * + Added detection for Yahoo! Slurp
103 *
104 * 2009-03-14:
105 * + Added detection for iPods.
106 * + Added Platform detection for iPhones
107 * + Added Platform detection for iPods
108 *
109 * 2009-02-16: (Rick Hale)
110 * + Added version detection for Android phones.
111 *
112 * 2008-12-09:
113 * + Removed unused constant
114 *
115 * 2008-11-07:
116 * + Added Google's Chrome to the detection list
117 * + Added isBrowser(string) to the list of functions special thanks to
118 * Daniel 'mavrick' Lang for the function concept (http://mavrick.id.au)
119 *
120 *
121 * Gary White noted: "Since browser detection is so unreliable, I am
122 * no longer maintaining this script. You are free to use and or
123 * modify/update it as you want, however the author assumes no
124 * responsibility for the accuracy of the detected values."
125 *
126 * Anyone experienced with Gary's script might be interested in these notes:
127 *
128 * Added class constants
129 * Added detection and version detection for Google's Chrome
130 * Updated the version detection for Amaya
131 * Updated the version detection for Firefox
132 * Updated the version detection for Lynx
133 * Updated the version detection for WebTV
134 * Updated the version detection for NetPositive
135 * Updated the version detection for IE
136 * Updated the version detection for OmniWeb
137 * Updated the version detection for iCab
138 * Updated the version detection for Safari
139 * Updated Safari to remove mobile devices (iPhone)
140 * Added detection for iPhone
141 * Added detection for robots
142 * Added detection for mobile devices
143 * Added detection for BlackBerry
144 * Removed Netscape checks (matches heavily with firefox & mozilla)
145 *
146 */
147 class Browser {
148 public $_agent = '';
149 public $_browser_name = '';
150 public $_version = '';
151 public $_platform = '';
152 public $_os = '';
153 public $_is_aol = false;
154 public $_is_mobile = false;
155 public $_is_robot = false;
156 public $_aol_version = '';
157
158 public $BROWSER_UNKNOWN = 'unknown';
159 public $VERSION_UNKNOWN = 'unknown';
160
161 public $BROWSER_OPERA = 'Opera'; // Http://www.opera.com/
162 public $BROWSER_OPERA_MINI = 'Opera Mini'; // Http://www.opera.com/mini/
163 public $BROWSER_WEBTV = 'WebTV'; // Http://www.webtv.net/pc/
164 public $BROWSER_IE = 'Internet Explorer'; // Http://www.microsoft.com/ie/
165 public $BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // Http://en.wikipedia.org/wiki/Internet_Explorer_Mobile
166 public $BROWSER_KONQUEROR = 'Konqueror'; // Http://www.konqueror.org/
167 public $BROWSER_ICAB = 'iCab'; // Http://www.icab.de/
168 public $BROWSER_OMNIWEB = 'OmniWeb'; // Http://www.omnigroup.com/applications/omniweb/
169 public $BROWSER_FIREBIRD = 'Firebird'; // Http://www.ibphoenix.com/
170 public $BROWSER_FIREFOX = 'Firefox'; // Http://www.mozilla.com/en-US/firefox/firefox.html
171 public $BROWSER_ICEWEASEL = 'Iceweasel'; // Http://www.geticeweasel.org/
172 public $BROWSER_SHIRETOKO = 'Shiretoko'; // Http://wiki.mozilla.org/Projects/shiretoko
173 public $BROWSER_MOZILLA = 'Mozilla'; // Http://www.mozilla.com/en-US/
174 public $BROWSER_AMAYA = 'Amaya'; // Http://www.w3.org/Amaya/
175 public $BROWSER_LYNX = 'Lynx'; // Http://en.wikipedia.org/wiki/Lynx
176 public $BROWSER_SAFARI = 'Safari'; // Http://apple.com
177 public $BROWSER_IPHONE = 'iPhone'; // Http://apple.com
178 public $BROWSER_IPOD = 'iPod'; // Http://apple.com
179 public $BROWSER_IPAD = 'iPad'; // Http://apple.com
180 public $BROWSER_CHROME = 'Chrome'; // Http://www.google.com/chrome
181 public $BROWSER_ANDROID = 'Android'; // Http://www.android.com/
182 public $BROWSER_GOOGLEBOT = 'GoogleBot'; // Http://en.wikipedia.org/wiki/Googlebot
183 public $BROWSER_SLURP = 'Yahoo! Slurp'; // Http://en.wikipedia.org/wiki/Yahoo!_Slurp
184 public $BROWSER_W3CVALIDATOR = 'W3C Validator'; // Http://validator.w3.org/
185 public $BROWSER_BLACKBERRY = 'BlackBerry'; // Http://www.blackberry.com/
186 public $BROWSER_ICECAT = 'IceCat'; // Http://en.wikipedia.org/wiki/GNU_IceCat
187 public $BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // Http://en.wikipedia.org/wiki/Web_Browser_for_S60
188 public $BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform
189 public $BROWSER_MSN = 'MSN Browser'; // Http://explorer.msn.com/
190 public $BROWSER_MSNBOT = 'MSN Bot'; // Http://search.msn.com/msnbot.htm
191 // Http://en.wikipedia.org/wiki/Msnbot (used for Bing as well)
192
193 public $BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // Http://browser.netscape.com/ (DEPRECATED)
194 public $BROWSER_GALEON = 'Galeon'; // Http://galeon.sourceforge.net/ (DEPRECATED)
195 public $BROWSER_NETPOSITIVE = 'NetPositive'; // Http://en.wikipedia.org/wiki/NetPositive (DEPRECATED)
196 public $BROWSER_PHOENIX = 'Phoenix'; // Http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED)
197
198 public $PLATFORM_UNKNOWN = 'unknown';
199 public $PLATFORM_WINDOWS = 'Windows';
200 public $PLATFORM_WINDOWS_CE = 'Windows CE';
201 public $PLATFORM_APPLE = 'Apple';
202 public $PLATFORM_LINUX = 'Linux';
203 public $PLATFORM_OS2 = 'OS/2';
204 public $PLATFORM_BEOS = 'BeOS';
205 public $PLATFORM_IPHONE = 'iPhone';
206 public $PLATFORM_IPOD = 'iPod';
207 public $PLATFORM_IPAD = 'iPad';
208 public $PLATFORM_BLACKBERRY = 'BlackBerry';
209 public $PLATFORM_NOKIA = 'Nokia';
210 public $PLATFORM_FREEBSD = 'FreeBSD';
211 public $PLATFORM_OPENBSD = 'OpenBSD';
212 public $PLATFORM_NETBSD = 'NetBSD';
213 public $PLATFORM_SUNOS = 'SunOS';
214 public $PLATFORM_OPENSOLARIS = 'OpenSolaris';
215 public $PLATFORM_ANDROID = 'Android';
216
217 public $OPERATING_SYSTEM_UNKNOWN = 'unknown';
218
219 /**
220 * @since 4.9.0 rename function - PHP 8 compatibility
221 */
222 public function __construct( $useragent = "" ) {
223 $this->reset();
224 if ( $useragent != "" ) {
225 $this->setUserAgent( $useragent );
226 } else {
227 $this->determine();
228 }
229 }
230
231 /**
232 * Reset all properties
233 */
234 function reset() {
235 $this->_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : "";
236 $this->_browser_name = $this->BROWSER_UNKNOWN;
237 $this->_version = $this->VERSION_UNKNOWN;
238 $this->_platform = $this->PLATFORM_UNKNOWN;
239 $this->_os = $this->OPERATING_SYSTEM_UNKNOWN;
240 $this->_is_aol = false;
241 $this->_is_mobile = false;
242 $this->_is_robot = false;
243 $this->_aol_version = $this->VERSION_UNKNOWN;
244 }
245
246 /**
247 * Check to see if the specific browser is valid
248 *
249 * @param string $browserName
250 *
251 * @return True if the browser is the specified browser
252 */
253 function isBrowser( $browserName ) {
254 return ( 0 == strcasecmp( $this->_browser_name, trim( $browserName ) ) );
255 }
256
257 /**
258 * The name of the browser. All return types are from the class contants
259 * @return string Name of the browser
260 */
261 function getBrowser() {
262 return $this->_browser_name;
263 }
264
265 /**
266 * Set the name of the browser
267 *
268 * @param $browser The name of the Browser
269 */
270 function setBrowser( $browser ) {
271 return $this->_browser_name = $browser;
272 }
273
274 /**
275 * The name of the platform. All return types are from the class contants
276 * @return string Name of the browser
277 */
278 function getPlatform() {
279 return $this->_platform;
280 }
281
282 /**
283 * Set the name of the platform
284 *
285 * @param $platform The name of the Platform
286 */
287 function setPlatform( $platform ) {
288 return $this->_platform = $platform;
289 }
290
291 /**
292 * The version of the browser.
293 * @return string Version of the browser (will only contain alpha-numeric characters and a period)
294 */
295 function getVersion() {
296 return $this->_version;
297 }
298
299 /**
300 * Set the version of the browser
301 *
302 * @param $version The version of the Browser
303 */
304 function setVersion( $version ) {
305 $this->_version = preg_replace( '/[^0-9,.,a-z,A-Z-]/', '', $version );
306 }
307
308 /**
309 * The version of AOL.
310 * @return string Version of AOL (will only contain alpha-numeric characters and a period)
311 */
312 function getAolVersion() {
313 return $this->_aol_version;
314 }
315
316 /**
317 * Set the version of AOL
318 *
319 * @param $version The version of AOL
320 */
321 function setAolVersion( $version ) {
322 $this->_aol_version = preg_replace( '/[^0-9,.,a-z,A-Z]/', '', $version );
323 }
324
325 /**
326 * Is the browser from AOL?
327 * @return boolean True if the browser is from AOL otherwise false
328 */
329 function isAol() {
330 return $this->_is_aol;
331 }
332
333 /**
334 * Is the browser from a mobile device?
335 * @return boolean True if the browser is from a mobile device otherwise false
336 */
337 function isMobile() {
338 return $this->_is_mobile;
339 }
340
341 /**
342 * Is the browser from a robot (ex Slurp,GoogleBot)?
343 * @return boolean True if the browser is from a robot otherwise false
344 */
345 function isRobot() {
346 return $this->_is_robot;
347 }
348
349 /**
350 * Set the browser to be from AOL
351 *
352 * @param $isAol
353 */
354 function setAol( $isAol ) {
355 $this->_is_aol = $isAol;
356 }
357
358 /**
359 * Set the Browser to be mobile
360 *
361 * @param boolean $value is the browser a mobile brower or not
362 */
363 function setMobile( $value = true ) {
364 $this->_is_mobile = $value;
365 }
366
367 /**
368 * Set the Browser to be a robot
369 *
370 * @param boolean $value is the browser a robot or not
371 */
372 function setRobot( $value = true ) {
373 $this->_is_robot = $value;
374 }
375
376 /**
377 * Get the user agent value in use to determine the browser
378 * @return string The user agent from the HTTP header
379 */
380 function getUserAgent() {
381 return $this->_agent;
382 }
383
384 /**
385 * Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
386 *
387 * @param $agent_string The value for the User Agent
388 */
389 function setUserAgent( $agent_string ) {
390 $this->reset();
391 $this->_agent = $agent_string;
392 $this->determine();
393 }
394
395 /**
396 * Used to determine if the browser is actually "chromeframe"
397 * @since 1.7
398 * @return boolean True if the browser is using chromeframe
399 */
400 function isChromeFrame() {
401 return ( strpos( $this->_agent, "chromeframe" ) !== false );
402 }
403
404 /**
405 * Returns a formatted string with a summary of the details of the browser.
406 * @return string formatted string with a summary of the browser
407 */
408 function __toString() {
409 $text1 = $this->getUserAgent(); //grabs the UA (user agent) string
410 $UAline1 = substr( $text1, 0, 32 ); //the first line we print should only be the first 32 characters of the UA string
411 $text2 = $this->getUserAgent();//now we grab it again and save it to a string
412 $towrapUA = str_replace( $UAline1, '', $text2 );//the rest of the printoff (other than first line) is equivolent
413 // To the whole string minus the part we printed off. IE
414 // User Agent: thefirst32charactersfromUAline1
415 // the rest of it is now stored in
416 // $text2 to be printed off
417 // But we need to add spaces before each line that is split other than line 1
418 $space = '';
419 for ( $i = 0; $i < 25; $i ++ ) {
420 $space .= ' ';
421 }
422 // Now we split the remaining string of UA ($text2) into lines that are prefixed by spaces for formatting
423 $wordwrapped = chunk_split( $towrapUA, 32, "\n $space" );
424
425 return "Platform: {$this->getPlatform()} \n" .
426 "Browser Name: {$this->getBrowser()} \n" .
427 "Browser Version: {$this->getVersion()} \n" .
428 "User Agent String: $UAline1 \n\t\t\t " .
429 "$wordwrapped";
430 }
431
432 /**
433 * Protected routine to calculate and determine what the browser is in use (including platform)
434 */
435 function determine() {
436 $this->checkPlatform();
437 $this->checkBrowsers();
438 $this->checkForAol();
439 }
440
441 /**
442 * Protected routine to determine the browser type
443 * @return boolean True if the browser was detected otherwise false
444 */
445 function checkBrowsers() {
446 return (
447 // Well-known, well-used
448 // Special Notes:
449 // (1) Opera must be checked before FireFox due to the odd
450 // user agents used in some older versions of Opera
451 // (2) WebTV is strapped onto Internet Explorer so we must
452 // check for WebTV before IE
453 // (3) (deprecated) Galeon is based on Firefox and needs to be
454 // tested before Firefox is tested
455 // (4) OmniWeb is based on Safari so OmniWeb check must occur
456 // before Safari
457 // (5) Netscape 9+ is based on Firefox so Netscape checks
458 // before FireFox are necessary
459 $this->checkBrowserWebTv() ||
460 $this->checkBrowserInternetExplorer() ||
461 $this->checkBrowserOpera() ||
462 $this->checkBrowserGaleon() ||
463 $this->checkBrowserNetscapeNavigator9Plus() ||
464 $this->checkBrowserFirefox() ||
465 $this->checkBrowserChrome() ||
466 $this->checkBrowserOmniWeb() ||
467
468 // Common mobile
469 $this->checkBrowserAndroid() ||
470 $this->checkBrowseriPad() ||
471 $this->checkBrowseriPod() ||
472 $this->checkBrowseriPhone() ||
473 $this->checkBrowserBlackBerry() ||
474 $this->checkBrowserNokia() ||
475
476 // Common bots
477 $this->checkBrowserGoogleBot() ||
478 $this->checkBrowserMSNBot() ||
479 $this->checkBrowserSlurp() ||
480
481 // WebKit base check (post mobile and others)
482 $this->checkBrowserSafari() ||
483
484 // Everyone else
485 $this->checkBrowserNetPositive() ||
486 $this->checkBrowserFirebird() ||
487 $this->checkBrowserKonqueror() ||
488 $this->checkBrowserIcab() ||
489 $this->checkBrowserPhoenix() ||
490 $this->checkBrowserAmaya() ||
491 $this->checkBrowserLynx() ||
492
493 $this->checkBrowserShiretoko() ||
494 $this->checkBrowserIceCat() ||
495 $this->checkBrowserW3CValidator() ||
496 $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
497 );
498 }
499
500 /**
501 * Determine if the user is using a BlackBerry (last updated 1.7)
502 * @return boolean True if the browser is the BlackBerry browser otherwise false
503 */
504 function checkBrowserBlackBerry() {
505 if ( stripos( $this->_agent, 'blackberry' ) !== false ) {
506 $aresult = explode( "/", stristr( $this->_agent, "BlackBerry" ) );
507 $aversion = explode( ' ', $aresult[1] );
508 $this->setVersion( $aversion[0] );
509 $this->_browser_name = $this->BROWSER_BLACKBERRY;
510 $this->setMobile( true );
511
512 return true;
513 }
514
515 return false;
516 }
517
518 /**
519 * Determine if the user is using an AOL User Agent (last updated 1.7)
520 * @return boolean True if the browser is from AOL otherwise false
521 */
522 function checkForAol() {
523 $this->setAol( false );
524 $this->setAolVersion( $this->VERSION_UNKNOWN );
525
526 if ( stripos( $this->_agent, 'aol' ) !== false ) {
527 $aversion = explode( ' ', stristr( $this->_agent, 'AOL' ) );
528 $this->setAol( true );
529 $this->setAolVersion( preg_replace( '/[^0-9\.a-z]/i', '', $aversion[1] ) );
530
531 return true;
532 }
533
534 return false;
535 }
536
537 /**
538 * Determine if the browser is the GoogleBot or not (last updated 1.7)
539 * @return boolean True if the browser is the GoogletBot otherwise false
540 */
541 function checkBrowserGoogleBot() {
542 if ( stripos( $this->_agent, 'googlebot' ) !== false ) {
543 $aresult = explode( '/', stristr( $this->_agent, 'googlebot' ) );
544 $aversion = explode( ' ', $aresult[1] );
545 $this->setVersion( str_replace( ';', '', $aversion[0] ) );
546 $this->_browser_name = $this->BROWSER_GOOGLEBOT;
547 $this->setRobot( true );
548
549 return true;
550 }
551
552 return false;
553 }
554
555 /**
556 * Determine if the browser is the MSNBot or not (last updated 2.0)
557 * @return boolean True if the browser is the MSNBot otherwise false
558 */
559 function checkBrowserMSNBot() {
560 if ( stripos( $this->_agent, "msnbot" ) !== false ) {
561 $aresult = explode( "/", stristr( $this->_agent, "msnbot" ) );
562 $aversion = explode( " ", $aresult[1] );
563 $this->setVersion( str_replace( ";", "", $aversion[0] ) );
564 $this->_browser_name = $this->BROWSER_MSNBOT;
565 $this->setRobot( true );
566
567 return true;
568 }
569
570 return false;
571 }
572
573 /**
574 * Determine if the browser is the W3C Validator or not (last updated 1.7)
575 * @return boolean True if the browser is the W3C Validator otherwise false
576 */
577 function checkBrowserW3CValidator() {
578 if ( stripos( $this->_agent, 'W3C-checklink' ) !== false ) {
579 $aresult = explode( '/', stristr( $this->_agent, 'W3C-checklink' ) );
580 $aversion = explode( ' ', $aresult[1] );
581 $this->setVersion( $aversion[0] );
582 $this->_browser_name = $this->BROWSER_W3CVALIDATOR;
583
584 return true;
585 } else if ( stripos( $this->_agent, 'W3C_Validator' ) !== false ) {
586 // Some of the Validator versions do not delineate w/ a slash - add it back in
587 $ua = str_replace( "W3C_Validator ", "W3C_Validator/", $this->_agent );
588 $aresult = explode( '/', stristr( $ua, 'W3C_Validator' ) );
589 $aversion = explode( ' ', $aresult[1] );
590 $this->setVersion( $aversion[0] );
591 $this->_browser_name = $this->BROWSER_W3CVALIDATOR;
592
593 return true;
594 }
595
596 return false;
597 }
598
599 /**
600 * Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
601 * @return boolean True if the browser is the Yahoo! Slurp Robot otherwise false
602 */
603 function checkBrowserSlurp() {
604 if ( stripos( $this->_agent, 'slurp' ) !== false ) {
605 $aresult = explode( '/', stristr( $this->_agent, 'Slurp' ) );
606 $aversion = explode( ' ', $aresult[1] );
607 $this->setVersion( $aversion[0] );
608 $this->_browser_name = $this->BROWSER_SLURP;
609 $this->setRobot( true );
610 $this->setMobile( false );
611
612 return true;
613 }
614
615 return false;
616 }
617
618 /**
619 * Determine if the browser is Internet Explorer or not (last updated 1.7)
620 * @return boolean True if the browser is Internet Explorer otherwise false
621 */
622 function checkBrowserInternetExplorer() {
623
624 // Test for v1 - v1.5 IE
625 if ( stripos( $this->_agent, 'microsoft internet explorer' ) !== false ) {
626 $this->setBrowser( $this->BROWSER_IE );
627 $this->setVersion( '1.0' );
628 $aresult = stristr( $this->_agent, '/' );
629 if ( preg_match( '/308|425|426|474|0b1/i', $aresult ) ) {
630 $this->setVersion( '1.5' );
631 }
632
633 return true;
634 } // Test for versions > 1.5
635 else if ( stripos( $this->_agent, 'msie' ) !== false && stripos( $this->_agent, 'opera' ) === false ) {
636 // See if the browser is the odd MSN Explorer
637 if ( stripos( $this->_agent, 'msnb' ) !== false ) {
638 $aresult = explode( ' ', stristr( str_replace( ';', '; ', $this->_agent ), 'MSN' ) );
639 $this->setBrowser( $this->BROWSER_MSN );
640 $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aresult[1] ) );
641
642 return true;
643 }
644 $aresult = explode( ' ', stristr( str_replace( ';', '; ', $this->_agent ), 'msie' ) );
645 $this->setBrowser( $this->BROWSER_IE );
646 $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aresult[1] ) );
647
648 return true;
649 } // Test for Pocket IE
650 else if ( stripos( $this->_agent, 'mspie' ) !== false || stripos( $this->_agent, 'pocket' ) !== false ) {
651 $aresult = explode( ' ', stristr( $this->_agent, 'mspie' ) );
652 $this->setPlatform( $this->PLATFORM_WINDOWS_CE );
653 $this->setBrowser( $this->BROWSER_POCKET_IE );
654 $this->setMobile( true );
655
656 if ( stripos( $this->_agent, 'mspie' ) !== false ) {
657 $this->setVersion( $aresult[1] );
658 } else {
659 $aversion = explode( '/', $this->_agent );
660 $this->setVersion( $aversion[1] );
661 }
662
663 return true;
664 }
665
666 return false;
667 }
668
669 /**
670 * Determine if the browser is Opera or not (last updated 1.7)
671 * @return boolean True if the browser is Opera otherwise false
672 */
673 function checkBrowserOpera() {
674 if ( stripos( $this->_agent, 'opera mini' ) !== false ) {
675 $resultant = stristr( $this->_agent, 'opera mini' );
676 if ( preg_match( '/\//', $resultant ) ) {
677 $aresult = explode( '/', $resultant );
678 $aversion = explode( ' ', $aresult[1] );
679 $this->setVersion( $aversion[0] );
680 } else {
681 $aversion = explode( ' ', stristr( $resultant, 'opera mini' ) );
682 $this->setVersion( $aversion[1] );
683 }
684 $this->_browser_name = $this->BROWSER_OPERA_MINI;
685 $this->setMobile( true );
686
687 return true;
688 } else if ( stripos( $this->_agent, 'opera' ) !== false ) {
689 $resultant = stristr( $this->_agent, 'opera' );
690 if ( preg_match( '/Version\/(10.*)$/', $resultant, $matches ) ) {
691 $this->setVersion( $matches[1] );
692 } else if ( preg_match( '/\//', $resultant ) ) {
693 $aresult = explode( '/', str_replace( "(", " ", $resultant ) );
694 $aversion = explode( ' ', $aresult[1] );
695 $this->setVersion( $aversion[0] );
696 } else {
697 $aversion = explode( ' ', stristr( $resultant, 'opera' ) );
698 $this->setVersion( isset( $aversion[1] ) ? $aversion[1] : "" );
699 }
700 $this->_browser_name = $this->BROWSER_OPERA;
701
702 return true;
703 }
704
705 return false;
706 }
707
708 /**
709 * Determine if the browser is Chrome or not (last updated 1.7)
710 * @return boolean True if the browser is Chrome otherwise false
711 */
712 function checkBrowserChrome() {
713 if ( stripos( $this->_agent, 'Chrome' ) !== false ) {
714 $aresult = explode( '/', stristr( $this->_agent, 'Chrome' ) );
715 $aversion = explode( ' ', $aresult[1] );
716 $this->setVersion( $aversion[0] );
717 $this->setBrowser( $this->BROWSER_CHROME );
718
719 return true;
720 }
721
722 return false;
723 }
724
725
726 /**
727 * Determine if the browser is WebTv or not (last updated 1.7)
728 * @return boolean True if the browser is WebTv otherwise false
729 */
730 function checkBrowserWebTv() {
731 if ( stripos( $this->_agent, 'webtv' ) !== false ) {
732 $aresult = explode( '/', stristr( $this->_agent, 'webtv' ) );
733 $aversion = explode( ' ', $aresult[1] );
734 $this->setVersion( $aversion[0] );
735 $this->setBrowser( $this->BROWSER_WEBTV );
736
737 return true;
738 }
739
740 return false;
741 }
742
743 /**
744 * Determine if the browser is NetPositive or not (last updated 1.7)
745 * @return boolean True if the browser is NetPositive otherwise false
746 */
747 function checkBrowserNetPositive() {
748 if ( stripos( $this->_agent, 'NetPositive' ) !== false ) {
749 $aresult = explode( '/', stristr( $this->_agent, 'NetPositive' ) );
750 $aversion = explode( ' ', $aresult[1] );
751 $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aversion[0] ) );
752 $this->setBrowser( $this->BROWSER_NETPOSITIVE );
753
754 return true;
755 }
756
757 return false;
758 }
759
760 /**
761 * Determine if the browser is Galeon or not (last updated 1.7)
762 * @return boolean True if the browser is Galeon otherwise false
763 */
764 function checkBrowserGaleon() {
765 if ( stripos( $this->_agent, 'galeon' ) !== false ) {
766 $aresult = explode( ' ', stristr( $this->_agent, 'galeon' ) );
767 $aversion = explode( '/', $aresult[0] );
768 $this->setVersion( $aversion[1] );
769 $this->setBrowser( $this->BROWSER_GALEON );
770
771 return true;
772 }
773
774 return false;
775 }
776
777 /**
778 * Determine if the browser is Konqueror or not (last updated 1.7)
779 * @return boolean True if the browser is Konqueror otherwise false
780 */
781 function checkBrowserKonqueror() {
782 if ( stripos( $this->_agent, 'Konqueror' ) !== false ) {
783 $aresult = explode( ' ', stristr( $this->_agent, 'Konqueror' ) );
784 $aversion = explode( '/', $aresult[0] );
785 $this->setVersion( $aversion[1] );
786 $this->setBrowser( $this->BROWSER_KONQUEROR );
787
788 return true;
789 }
790
791 return false;
792 }
793
794 /**
795 * Determine if the browser is iCab or not (last updated 1.7)
796 * @return boolean True if the browser is iCab otherwise false
797 */
798 function checkBrowserIcab() {
799 if ( stripos( $this->_agent, 'icab' ) !== false ) {
800 $aversion = explode( ' ', stristr( str_replace( '/', ' ', $this->_agent ), 'icab' ) );
801 $this->setVersion( $aversion[1] );
802 $this->setBrowser( $this->BROWSER_ICAB );
803
804 return true;
805 }
806
807 return false;
808 }
809
810 /**
811 * Determine if the browser is OmniWeb or not (last updated 1.7)
812 * @return boolean True if the browser is OmniWeb otherwise false
813 */
814 function checkBrowserOmniWeb() {
815 if ( stripos( $this->_agent, 'omniweb' ) !== false ) {
816 $aresult = explode( '/', stristr( $this->_agent, 'omniweb' ) );
817 $aversion = explode( ' ', isset( $aresult[1] ) ? $aresult[1] : "" );
818 $this->setVersion( $aversion[0] );
819 $this->setBrowser( $this->BROWSER_OMNIWEB );
820
821 return true;
822 }
823
824 return false;
825 }
826
827 /**
828 * Determine if the browser is Phoenix or not (last updated 1.7)
829 * @return boolean True if the browser is Phoenix otherwise false
830 */
831 function checkBrowserPhoenix() {
832 if ( stripos( $this->_agent, 'Phoenix' ) !== false ) {
833 $aversion = explode( '/', stristr( $this->_agent, 'Phoenix' ) );
834 $this->setVersion( $aversion[1] );
835 $this->setBrowser( $this->BROWSER_PHOENIX );
836
837 return true;
838 }
839
840 return false;
841 }
842
843 /**
844 * Determine if the browser is Firebird or not (last updated 1.7)
845 * @return boolean True if the browser is Firebird otherwise false
846 */
847 function checkBrowserFirebird() {
848 if ( stripos( $this->_agent, 'Firebird' ) !== false ) {
849 $aversion = explode( '/', stristr( $this->_agent, 'Firebird' ) );
850 $this->setVersion( $aversion[1] );
851 $this->setBrowser( $this->BROWSER_FIREBIRD );
852
853 return true;
854 }
855
856 return false;
857 }
858
859 /**
860 * Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7)
861 * NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)
862 * @return boolean True if the browser is Netscape Navigator 9+ otherwise false
863 */
864 function checkBrowserNetscapeNavigator9Plus() {
865 if ( stripos( $this->_agent, 'Firefox' ) !== false && preg_match( '/Navigator\/([^ ]*)/i', $this->_agent, $matches ) ) {
866 $this->setVersion( $matches[1] );
867 $this->setBrowser( $this->BROWSER_NETSCAPE_NAVIGATOR );
868
869 return true;
870 } else if ( stripos( $this->_agent, 'Firefox' ) === false && preg_match( '/Netscape6?\/([^ ]*)/i', $this->_agent, $matches ) ) {
871 $this->setVersion( $matches[1] );
872 $this->setBrowser( $this->BROWSER_NETSCAPE_NAVIGATOR );
873
874 return true;
875 }
876
877 return false;
878 }
879
880 /**
881 * Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
882 * @return boolean True if the browser is Shiretoko otherwise false
883 */
884 function checkBrowserShiretoko() {
885 if ( stripos( $this->_agent, 'Mozilla' ) !== false && preg_match( '/Shiretoko\/([^ ]*)/i', $this->_agent, $matches ) ) {
886 $this->setVersion( $matches[1] );
887 $this->setBrowser( $this->BROWSER_SHIRETOKO );
888
889 return true;
890 }
891
892 return false;
893 }
894
895 /**
896 * Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
897 * @return boolean True if the browser is Ice Cat otherwise false
898 */
899 function checkBrowserIceCat() {
900 if ( stripos( $this->_agent, 'Mozilla' ) !== false && preg_match( '/IceCat\/([^ ]*)/i', $this->_agent, $matches ) ) {
901 $this->setVersion( $matches[1] );
902 $this->setBrowser( $this->BROWSER_ICECAT );
903
904 return true;
905 }
906
907 return false;
908 }
909
910 /**
911 * Determine if the browser is Nokia or not (last updated 1.7)
912 * @return boolean True if the browser is Nokia otherwise false
913 */
914 function checkBrowserNokia() {
915 if ( preg_match( "/Nokia([^\/]+)\/([^ SP]+)/i", $this->_agent, $matches ) ) {
916 $this->setVersion( $matches[2] );
917 if ( stripos( $this->_agent, 'Series60' ) !== false || strpos( $this->_agent, 'S60' ) !== false ) {
918 $this->setBrowser( $this->BROWSER_NOKIA_S60 );
919 } else {
920 $this->setBrowser( $this->BROWSER_NOKIA );
921 }
922 $this->setMobile( true );
923
924 return true;
925 }
926
927 return false;
928 }
929
930 /**
931 * Determine if the browser is Firefox or not (last updated 1.7)
932 * @return boolean True if the browser is Firefox otherwise false
933 */
934 function checkBrowserFirefox() {
935 if ( stripos( $this->_agent, 'safari' ) === false ) {
936 if ( preg_match( "/Firefox[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches ) ) {
937 $this->setVersion( $matches[1] );
938 $this->setBrowser( $this->BROWSER_FIREFOX );
939
940 return true;
941 } else if ( preg_match( "/Firefox$/i", $this->_agent, $matches ) ) {
942 $this->setVersion( "" );
943 $this->setBrowser( $this->BROWSER_FIREFOX );
944
945 return true;
946 }
947 }
948
949 return false;
950 }
951
952 /**
953 * Determine if the browser is Firefox or not (last updated 1.7)
954 * @return boolean True if the browser is Firefox otherwise false
955 */
956 function checkBrowserIceweasel() {
957 if ( stripos( $this->_agent, 'Iceweasel' ) !== false ) {
958 $aresult = explode( '/', stristr( $this->_agent, 'Iceweasel' ) );
959 $aversion = explode( ' ', $aresult[1] );
960 $this->setVersion( $aversion[0] );
961 $this->setBrowser( $this->BROWSER_ICEWEASEL );
962
963 return true;
964 }
965
966 return false;
967 }
968
969 /**
970 * Determine if the browser is Mozilla or not (last updated 1.7)
971 * @return boolean True if the browser is Mozilla otherwise false
972 */
973 function checkBrowserMozilla() {
974 if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/rv:[0-9].[0-9][a-b]?/i', $this->_agent ) && stripos( $this->_agent, 'netscape' ) === false ) {
975 $aversion = explode( ' ', stristr( $this->_agent, 'rv:' ) );
976 preg_match( '/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion );
977 $this->setVersion( str_replace( 'rv:', '', $aversion[0] ) );
978 $this->setBrowser( $this->BROWSER_MOZILLA );
979
980 return true;
981 } else if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/rv:[0-9]\.[0-9]/i', $this->_agent ) && stripos( $this->_agent, 'netscape' ) === false ) {
982 $aversion = explode( '', stristr( $this->_agent, 'rv:' ) );
983 $this->setVersion( str_replace( 'rv:', '', $aversion[0] ) );
984 $this->setBrowser( $this->BROWSER_MOZILLA );
985
986 return true;
987 } else if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/mozilla\/([^ ]*)/i', $this->_agent, $matches ) && stripos( $this->_agent, 'netscape' ) === false ) {
988 $this->setVersion( $matches[1] );
989 $this->setBrowser( $this->BROWSER_MOZILLA );
990
991 return true;
992 }
993
994 return false;
995 }
996
997 /**
998 * Determine if the browser is Lynx or not (last updated 1.7)
999 * @return boolean True if the browser is Lynx otherwise false
1000 */
1001 function checkBrowserLynx() {
1002 if ( stripos( $this->_agent, 'lynx' ) !== false ) {
1003 $aresult = explode( '/', stristr( $this->_agent, 'Lynx' ) );
1004 $aversion = explode( ' ', ( isset( $aresult[1] ) ? $aresult[1] : "" ) );
1005 $this->setVersion( $aversion[0] );
1006 $this->setBrowser( $this->BROWSER_LYNX );
1007
1008 return true;
1009 }
1010
1011 return false;
1012 }
1013
1014 /**
1015 * Determine if the browser is Amaya or not (last updated 1.7)
1016 * @return boolean True if the browser is Amaya otherwise false
1017 */
1018 function checkBrowserAmaya() {
1019 if ( stripos( $this->_agent, 'amaya' ) !== false ) {
1020 $aresult = explode( '/', stristr( $this->_agent, 'Amaya' ) );
1021 $aversion = explode( ' ', $aresult[1] );
1022 $this->setVersion( $aversion[0] );
1023 $this->setBrowser( $this->BROWSER_AMAYA );
1024
1025 return true;
1026 }
1027
1028 return false;
1029 }
1030
1031 /**
1032 * Determine if the browser is Safari or not (last updated 1.7)
1033 * @return boolean True if the browser is Safari otherwise false
1034 */
1035 function checkBrowserSafari() {
1036 if ( stripos( $this->_agent, 'Safari' ) !== false && stripos( $this->_agent, 'iPhone' ) === false && stripos( $this->_agent, 'iPod' ) === false ) {
1037 $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
1038 if ( isset( $aresult[1] ) ) {
1039 $aversion = explode( ' ', $aresult[1] );
1040 $this->setVersion( $aversion[0] );
1041 } else {
1042 $this->setVersion( $this->VERSION_UNKNOWN );
1043 }
1044 $this->setBrowser( $this->BROWSER_SAFARI );
1045
1046 return true;
1047 }
1048
1049 return false;
1050 }
1051
1052 /**
1053 * Determine if the browser is iPhone or not (last updated 1.7)
1054 * @return boolean True if the browser is iPhone otherwise false
1055 */
1056 function checkBrowseriPhone() {
1057 if ( stripos( $this->_agent, 'iPhone' ) !== false ) {
1058 $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
1059 if ( isset( $aresult[1] ) ) {
1060 $aversion = explode( ' ', $aresult[1] );
1061 $this->setVersion( $aversion[0] );
1062 } else {
1063 $this->setVersion( $this->VERSION_UNKNOWN );
1064 }
1065 $this->setMobile( true );
1066 $this->setBrowser( $this->BROWSER_IPHONE );
1067
1068 return true;
1069 }
1070
1071 return false;
1072 }
1073
1074 /**
1075 * Determine if the browser is iPod or not (last updated 1.7)
1076 * @return boolean True if the browser is iPod otherwise false
1077 */
1078 function checkBrowseriPad() {
1079 if ( stripos( $this->_agent, 'iPad' ) !== false ) {
1080 $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
1081 if ( isset( $aresult[1] ) ) {
1082 $aversion = explode( ' ', $aresult[1] );
1083 $this->setVersion( $aversion[0] );
1084 } else {
1085 $this->setVersion( $this->VERSION_UNKNOWN );
1086 }
1087 $this->setMobile( true );
1088 $this->setBrowser( $this->BROWSER_IPAD );
1089
1090 return true;
1091 }
1092
1093 return false;
1094 }
1095
1096 /**
1097 * Determine if the browser is iPod or not (last updated 1.7)
1098 * @return boolean True if the browser is iPod otherwise false
1099 */
1100 function checkBrowseriPod() {
1101 if ( stripos( $this->_agent, 'iPod' ) !== false ) {
1102 $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
1103 if ( isset( $aresult[1] ) ) {
1104 $aversion = explode( ' ', $aresult[1] );
1105 $this->setVersion( $aversion[0] );
1106 } else {
1107 $this->setVersion( $this->VERSION_UNKNOWN );
1108 }
1109 $this->setMobile( true );
1110 $this->setBrowser( $this->BROWSER_IPOD );
1111
1112 return true;
1113 }
1114
1115 return false;
1116 }
1117
1118 /**
1119 * Determine if the browser is Android or not (last updated 1.7)
1120 * @return boolean True if the browser is Android otherwise false
1121 */
1122 function checkBrowserAndroid() {
1123 if ( stripos( $this->_agent, 'Android' ) !== false ) {
1124 $aresult = explode( ' ', stristr( $this->_agent, 'Android' ) );
1125 if ( isset( $aresult[1] ) ) {
1126 $aversion = explode( ' ', $aresult[1] );
1127 $this->setVersion( $aversion[0] );
1128 } else {
1129 $this->setVersion( $this->VERSION_UNKNOWN );
1130 }
1131 $this->setMobile( true );
1132 $this->setBrowser( $this->BROWSER_ANDROID );
1133
1134 return true;
1135 }
1136
1137 return false;
1138 }
1139
1140 /**
1141 * Determine the user's platform (last updated 1.7)
1142 */
1143 function checkPlatform() {
1144 if ( stripos( $this->_agent, 'windows' ) !== false ) {
1145 $this->_platform = $this->PLATFORM_WINDOWS;
1146 } else if ( stripos( $this->_agent, 'iPad' ) !== false ) {
1147 $this->_platform = $this->PLATFORM_IPAD;
1148 } else if ( stripos( $this->_agent, 'iPod' ) !== false ) {
1149 $this->_platform = $this->PLATFORM_IPOD;
1150 } else if ( stripos( $this->_agent, 'iPhone' ) !== false ) {
1151 $this->_platform = $this->PLATFORM_IPHONE;
1152 } elseif ( stripos( $this->_agent, 'mac' ) !== false ) {
1153 $this->_platform = $this->PLATFORM_APPLE;
1154 } elseif ( stripos( $this->_agent, 'android' ) !== false ) {
1155 $this->_platform = $this->PLATFORM_ANDROID;
1156 } elseif ( stripos( $this->_agent, 'linux' ) !== false ) {
1157 $this->_platform = $this->PLATFORM_LINUX;
1158 } else if ( stripos( $this->_agent, 'Nokia' ) !== false ) {
1159 $this->_platform = $this->PLATFORM_NOKIA;
1160 } else if ( stripos( $this->_agent, 'BlackBerry' ) !== false ) {
1161 $this->_platform = $this->PLATFORM_BLACKBERRY;
1162 } elseif ( stripos( $this->_agent, 'FreeBSD' ) !== false ) {
1163 $this->_platform = $this->PLATFORM_FREEBSD;
1164 } elseif ( stripos( $this->_agent, 'OpenBSD' ) !== false ) {
1165 $this->_platform = $this->PLATFORM_OPENBSD;
1166 } elseif ( stripos( $this->_agent, 'NetBSD' ) !== false ) {
1167 $this->_platform = $this->PLATFORM_NETBSD;
1168 } elseif ( stripos( $this->_agent, 'OpenSolaris' ) !== false ) {
1169 $this->_platform = $this->PLATFORM_OPENSOLARIS;
1170 } elseif ( stripos( $this->_agent, 'SunOS' ) !== false ) {
1171 $this->_platform = $this->PLATFORM_SUNOS;
1172 } elseif ( stripos( $this->_agent, 'OS\/2' ) !== false ) {
1173 $this->_platform = $this->PLATFORM_OS2;
1174 } elseif ( stripos( $this->_agent, 'BeOS' ) !== false ) {
1175 $this->_platform = $this->PLATFORM_BEOS;
1176 } elseif ( stripos( $this->_agent, 'win' ) !== false ) {
1177 $this->_platform = $this->PLATFORM_WINDOWS;
1178 }
1179
1180 }
1181 }
1182