blob: 2690e174d84d4ad99b4fb80e0c50df45abddf8d4 [file] [log] [blame]
Derek Allard2067d1a2008-11-13 22:59:24 +00001<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2/**
3 * CodeIgniter
4 *
Greg Aker741de1c2010-11-10 14:52:57 -06005 * An open source application development framework for PHP 5.1.6 or newer
Derek Allard2067d1a2008-11-13 22:59:24 +00006 *
7 * @package CodeIgniter
8 * @author ExpressionEngine Dev Team
Greg Aker0711dc82011-01-05 10:49:40 -06009 * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
Derek Allard2067d1a2008-11-13 22:59:24 +000010 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
12 * @since Version 1.0
13 * @filesource
14 */
15
16// ------------------------------------------------------------------------
17
18/**
19 * User Agent Class
20 *
21 * Identifies the platform, browser, robot, or mobile devise of the browsing agent
22 *
23 * @package CodeIgniter
24 * @subpackage Libraries
25 * @category User Agent
26 * @author ExpressionEngine Dev Team
27 * @link http://codeigniter.com/user_guide/libraries/user_agent.html
28 */
29class CI_User_agent {
30
31 var $agent = NULL;
Barry Mienydd671972010-10-04 16:33:58 +020032
Derek Allard2067d1a2008-11-13 22:59:24 +000033 var $is_browser = FALSE;
34 var $is_robot = FALSE;
35 var $is_mobile = FALSE;
36
37 var $languages = array();
38 var $charsets = array();
Barry Mienydd671972010-10-04 16:33:58 +020039
Derek Allard2067d1a2008-11-13 22:59:24 +000040 var $platforms = array();
41 var $browsers = array();
42 var $mobiles = array();
43 var $robots = array();
Barry Mienydd671972010-10-04 16:33:58 +020044
Derek Allard2067d1a2008-11-13 22:59:24 +000045 var $platform = '';
46 var $browser = '';
47 var $version = '';
48 var $mobile = '';
49 var $robot = '';
Barry Mienydd671972010-10-04 16:33:58 +020050
Derek Allard2067d1a2008-11-13 22:59:24 +000051 /**
52 * Constructor
53 *
54 * Sets the User Agent and runs the compilation routine
55 *
56 * @access public
57 * @return void
Barry Mienydd671972010-10-04 16:33:58 +020058 */
Greg Akera9263282010-11-10 15:26:43 -060059 public function __construct()
Derek Allard2067d1a2008-11-13 22:59:24 +000060 {
61 if (isset($_SERVER['HTTP_USER_AGENT']))
62 {
63 $this->agent = trim($_SERVER['HTTP_USER_AGENT']);
64 }
Barry Mienydd671972010-10-04 16:33:58 +020065
Derek Allard2067d1a2008-11-13 22:59:24 +000066 if ( ! is_null($this->agent))
67 {
68 if ($this->_load_agent_file())
69 {
70 $this->_compile_data();
71 }
72 }
Barry Mienydd671972010-10-04 16:33:58 +020073
Derek Allard2067d1a2008-11-13 22:59:24 +000074 log_message('debug', "User Agent Class Initialized");
75 }
Barry Mienydd671972010-10-04 16:33:58 +020076
Derek Allard2067d1a2008-11-13 22:59:24 +000077 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +020078
Derek Allard2067d1a2008-11-13 22:59:24 +000079 /**
80 * Compile the User Agent Data
81 *
82 * @access private
83 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +020084 */
Phil Sturgeondac1b462011-01-06 17:40:10 +000085 private function _load_agent_file()
Derek Allard2067d1a2008-11-13 22:59:24 +000086 {
bubbafoley0ea04142011-03-17 14:55:41 -050087 if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT))
88 {
89 $_ua_path = APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT;
90 }
91 else
92 {
93 $_ua_path = APPPATH.'config/user_agents'.EXT;
94 }
95
96 if ( ! @include($_ua_path))
Derek Allard2067d1a2008-11-13 22:59:24 +000097 {
98 return FALSE;
99 }
Barry Mienydd671972010-10-04 16:33:58 +0200100
Derek Allard2067d1a2008-11-13 22:59:24 +0000101 $return = FALSE;
Barry Mienydd671972010-10-04 16:33:58 +0200102
Derek Allard2067d1a2008-11-13 22:59:24 +0000103 if (isset($platforms))
104 {
105 $this->platforms = $platforms;
106 unset($platforms);
107 $return = TRUE;
108 }
109
110 if (isset($browsers))
111 {
112 $this->browsers = $browsers;
113 unset($browsers);
114 $return = TRUE;
115 }
116
117 if (isset($mobiles))
118 {
119 $this->mobiles = $mobiles;
120 unset($mobiles);
121 $return = TRUE;
122 }
Barry Mienydd671972010-10-04 16:33:58 +0200123
Derek Allard2067d1a2008-11-13 22:59:24 +0000124 if (isset($robots))
125 {
126 $this->robots = $robots;
127 unset($robots);
128 $return = TRUE;
129 }
130
131 return $return;
132 }
Barry Mienydd671972010-10-04 16:33:58 +0200133
Derek Allard2067d1a2008-11-13 22:59:24 +0000134 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200135
Derek Allard2067d1a2008-11-13 22:59:24 +0000136 /**
137 * Compile the User Agent Data
138 *
139 * @access private
140 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200141 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000142 private function _compile_data()
Derek Allard2067d1a2008-11-13 22:59:24 +0000143 {
144 $this->_set_platform();
Barry Mienydd671972010-10-04 16:33:58 +0200145
Derek Allard2067d1a2008-11-13 22:59:24 +0000146 foreach (array('_set_browser', '_set_robot', '_set_mobile') as $function)
147 {
148 if ($this->$function() === TRUE)
149 {
150 break;
151 }
Barry Mienydd671972010-10-04 16:33:58 +0200152 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000153 }
Barry Mienydd671972010-10-04 16:33:58 +0200154
Derek Allard2067d1a2008-11-13 22:59:24 +0000155 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200156
Derek Allard2067d1a2008-11-13 22:59:24 +0000157 /**
158 * Set the Platform
159 *
160 * @access private
161 * @return mixed
Barry Mienydd671972010-10-04 16:33:58 +0200162 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000163 private function _set_platform()
Derek Allard2067d1a2008-11-13 22:59:24 +0000164 {
165 if (is_array($this->platforms) AND count($this->platforms) > 0)
166 {
167 foreach ($this->platforms as $key => $val)
168 {
169 if (preg_match("|".preg_quote($key)."|i", $this->agent))
170 {
171 $this->platform = $val;
172 return TRUE;
173 }
174 }
175 }
176 $this->platform = 'Unknown Platform';
177 }
178
179 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200180
Derek Allard2067d1a2008-11-13 22:59:24 +0000181 /**
182 * Set the Browser
183 *
184 * @access private
185 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200186 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000187 private function _set_browser()
Derek Allard2067d1a2008-11-13 22:59:24 +0000188 {
189 if (is_array($this->browsers) AND count($this->browsers) > 0)
190 {
191 foreach ($this->browsers as $key => $val)
Barry Mienydd671972010-10-04 16:33:58 +0200192 {
Derek Allard2067d1a2008-11-13 22:59:24 +0000193 if (preg_match("|".preg_quote($key).".*?([0-9\.]+)|i", $this->agent, $match))
194 {
195 $this->is_browser = TRUE;
196 $this->version = $match[1];
197 $this->browser = $val;
198 $this->_set_mobile();
199 return TRUE;
200 }
201 }
202 }
203 return FALSE;
204 }
Barry Mienydd671972010-10-04 16:33:58 +0200205
Derek Allard2067d1a2008-11-13 22:59:24 +0000206 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200207
Derek Allard2067d1a2008-11-13 22:59:24 +0000208 /**
209 * Set the Robot
210 *
211 * @access private
212 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200213 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000214 private function _set_robot()
Derek Allard2067d1a2008-11-13 22:59:24 +0000215 {
216 if (is_array($this->robots) AND count($this->robots) > 0)
Barry Mienydd671972010-10-04 16:33:58 +0200217 {
Derek Allard2067d1a2008-11-13 22:59:24 +0000218 foreach ($this->robots as $key => $val)
219 {
220 if (preg_match("|".preg_quote($key)."|i", $this->agent))
221 {
222 $this->is_robot = TRUE;
223 $this->robot = $val;
224 return TRUE;
225 }
226 }
227 }
228 return FALSE;
229 }
230
231 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200232
Derek Allard2067d1a2008-11-13 22:59:24 +0000233 /**
234 * Set the Mobile Device
235 *
236 * @access private
237 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200238 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000239 private function _set_mobile()
Derek Allard2067d1a2008-11-13 22:59:24 +0000240 {
241 if (is_array($this->mobiles) AND count($this->mobiles) > 0)
Barry Mienydd671972010-10-04 16:33:58 +0200242 {
Derek Allard2067d1a2008-11-13 22:59:24 +0000243 foreach ($this->mobiles as $key => $val)
244 {
245 if (FALSE !== (strpos(strtolower($this->agent), $key)))
246 {
247 $this->is_mobile = TRUE;
248 $this->mobile = $val;
249 return TRUE;
250 }
251 }
Barry Mienydd671972010-10-04 16:33:58 +0200252 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000253 return FALSE;
254 }
Barry Mienydd671972010-10-04 16:33:58 +0200255
Derek Allard2067d1a2008-11-13 22:59:24 +0000256 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200257
Derek Allard2067d1a2008-11-13 22:59:24 +0000258 /**
259 * Set the accepted languages
260 *
261 * @access private
262 * @return void
Barry Mienydd671972010-10-04 16:33:58 +0200263 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000264 private function _set_languages()
Derek Allard2067d1a2008-11-13 22:59:24 +0000265 {
266 if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '')
267 {
268 $languages = preg_replace('/(;q=[0-9\.]+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE'])));
Barry Mienydd671972010-10-04 16:33:58 +0200269
Derek Allard2067d1a2008-11-13 22:59:24 +0000270 $this->languages = explode(',', $languages);
271 }
Barry Mienydd671972010-10-04 16:33:58 +0200272
Derek Allard2067d1a2008-11-13 22:59:24 +0000273 if (count($this->languages) == 0)
274 {
275 $this->languages = array('Undefined');
Barry Mienydd671972010-10-04 16:33:58 +0200276 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000277 }
Barry Mienydd671972010-10-04 16:33:58 +0200278
Derek Allard2067d1a2008-11-13 22:59:24 +0000279 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200280
Derek Allard2067d1a2008-11-13 22:59:24 +0000281 /**
282 * Set the accepted character sets
283 *
284 * @access private
285 * @return void
Barry Mienydd671972010-10-04 16:33:58 +0200286 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000287 private function _set_charsets()
Barry Mienydd671972010-10-04 16:33:58 +0200288 {
Derek Allard2067d1a2008-11-13 22:59:24 +0000289 if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '')
290 {
291 $charsets = preg_replace('/(;q=.+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_CHARSET'])));
Barry Mienydd671972010-10-04 16:33:58 +0200292
Derek Allard2067d1a2008-11-13 22:59:24 +0000293 $this->charsets = explode(',', $charsets);
294 }
Barry Mienydd671972010-10-04 16:33:58 +0200295
Derek Allard2067d1a2008-11-13 22:59:24 +0000296 if (count($this->charsets) == 0)
297 {
298 $this->charsets = array('Undefined');
Barry Mienydd671972010-10-04 16:33:58 +0200299 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000300 }
301
302 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200303
Derek Allard2067d1a2008-11-13 22:59:24 +0000304 /**
305 * Is Browser
306 *
307 * @access public
308 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200309 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000310 public function is_browser($key = NULL)
Derek Allard2067d1a2008-11-13 22:59:24 +0000311 {
Phil Sturgeondac1b462011-01-06 17:40:10 +0000312 if ( ! $this->is_browser)
313 {
314 return FALSE;
315 }
316
317 // No need to be specific, it's a browser
318 if ($key === NULL)
319 {
320 return TRUE;
321 }
322
323 // Check for a specific browser
324 return array_key_exists($key, $this->browsers) AND $this->browser === $this->browsers[$key];
Derek Allard2067d1a2008-11-13 22:59:24 +0000325 }
326
327 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200328
Derek Allard2067d1a2008-11-13 22:59:24 +0000329 /**
330 * Is Robot
331 *
332 * @access public
333 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200334 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000335 public function is_robot($key = NULL)
Derek Allard2067d1a2008-11-13 22:59:24 +0000336 {
Phil Sturgeondac1b462011-01-06 17:40:10 +0000337 if ( ! $this->is_robot)
338 {
339 return FALSE;
340 }
341
342 // No need to be specific, it's a robot
343 if ($key === NULL)
344 {
345 return TRUE;
346 }
347
348 // Check for a specific robot
349 return array_key_exists($key, $this->robots) AND $this->robot === $this->robots[$key];
Derek Allard2067d1a2008-11-13 22:59:24 +0000350 }
351
352 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200353
Derek Allard2067d1a2008-11-13 22:59:24 +0000354 /**
355 * Is Mobile
356 *
357 * @access public
358 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200359 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000360 public function is_mobile($key = NULL)
Derek Allard2067d1a2008-11-13 22:59:24 +0000361 {
Phil Sturgeondac1b462011-01-06 17:40:10 +0000362 if ( ! $this->is_mobile)
363 {
364 return FALSE;
365 }
366
367 // No need to be specific, it's a mobile
368 if ($key === NULL)
369 {
370 return TRUE;
371 }
372
373 // Check for a specific robot
374 return array_key_exists($key, $this->mobiles) AND $this->mobile === $this->mobiles[$key];
Barry Mienydd671972010-10-04 16:33:58 +0200375 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000376
377 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200378
Derek Allard2067d1a2008-11-13 22:59:24 +0000379 /**
380 * Is this a referral from another site?
381 *
382 * @access public
383 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200384 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000385 public function is_referral()
Derek Allard2067d1a2008-11-13 22:59:24 +0000386 {
Eric Barnesf6f51a62011-02-05 21:41:17 -0500387 if ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '')
388 {
389 return FALSE;
390 }
391 return TRUE;
Derek Allard2067d1a2008-11-13 22:59:24 +0000392 }
393
394 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200395
Derek Allard2067d1a2008-11-13 22:59:24 +0000396 /**
397 * Agent String
398 *
399 * @access public
400 * @return string
Barry Mienydd671972010-10-04 16:33:58 +0200401 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000402 public function agent_string()
Derek Allard2067d1a2008-11-13 22:59:24 +0000403 {
404 return $this->agent;
405 }
406
407 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200408
Derek Allard2067d1a2008-11-13 22:59:24 +0000409 /**
410 * Get Platform
411 *
412 * @access public
413 * @return string
Barry Mienydd671972010-10-04 16:33:58 +0200414 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000415 public function platform()
Derek Allard2067d1a2008-11-13 22:59:24 +0000416 {
417 return $this->platform;
418 }
419
420 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200421
Derek Allard2067d1a2008-11-13 22:59:24 +0000422 /**
423 * Get Browser Name
424 *
425 * @access public
426 * @return string
Barry Mienydd671972010-10-04 16:33:58 +0200427 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000428 public function browser()
Derek Allard2067d1a2008-11-13 22:59:24 +0000429 {
430 return $this->browser;
431 }
432
433 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200434
Derek Allard2067d1a2008-11-13 22:59:24 +0000435 /**
436 * Get the Browser Version
437 *
438 * @access public
439 * @return string
Barry Mienydd671972010-10-04 16:33:58 +0200440 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000441 public function version()
Derek Allard2067d1a2008-11-13 22:59:24 +0000442 {
443 return $this->version;
444 }
445
446 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200447
Derek Allard2067d1a2008-11-13 22:59:24 +0000448 /**
449 * Get The Robot Name
450 *
451 * @access public
452 * @return string
Barry Mienydd671972010-10-04 16:33:58 +0200453 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000454 public function robot()
Derek Allard2067d1a2008-11-13 22:59:24 +0000455 {
456 return $this->robot;
457 }
458 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200459
Derek Allard2067d1a2008-11-13 22:59:24 +0000460 /**
461 * Get the Mobile Device
462 *
463 * @access public
464 * @return string
Barry Mienydd671972010-10-04 16:33:58 +0200465 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000466 public function mobile()
Derek Allard2067d1a2008-11-13 22:59:24 +0000467 {
468 return $this->mobile;
469 }
Barry Mienydd671972010-10-04 16:33:58 +0200470
Derek Allard2067d1a2008-11-13 22:59:24 +0000471 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200472
Derek Allard2067d1a2008-11-13 22:59:24 +0000473 /**
474 * Get the referrer
475 *
476 * @access public
477 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200478 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000479 public function referrer()
Derek Allard2067d1a2008-11-13 22:59:24 +0000480 {
481 return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : trim($_SERVER['HTTP_REFERER']);
482 }
483
484 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200485
Derek Allard2067d1a2008-11-13 22:59:24 +0000486 /**
487 * Get the accepted languages
488 *
489 * @access public
490 * @return array
Barry Mienydd671972010-10-04 16:33:58 +0200491 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000492 public function languages()
Derek Allard2067d1a2008-11-13 22:59:24 +0000493 {
494 if (count($this->languages) == 0)
495 {
496 $this->_set_languages();
497 }
Barry Mienydd671972010-10-04 16:33:58 +0200498
Derek Allard2067d1a2008-11-13 22:59:24 +0000499 return $this->languages;
500 }
501
502 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200503
Derek Allard2067d1a2008-11-13 22:59:24 +0000504 /**
505 * Get the accepted Character Sets
506 *
507 * @access public
508 * @return array
Barry Mienydd671972010-10-04 16:33:58 +0200509 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000510 public function charsets()
Derek Allard2067d1a2008-11-13 22:59:24 +0000511 {
512 if (count($this->charsets) == 0)
513 {
514 $this->_set_charsets();
515 }
Barry Mienydd671972010-10-04 16:33:58 +0200516
Derek Allard2067d1a2008-11-13 22:59:24 +0000517 return $this->charsets;
518 }
Barry Mienydd671972010-10-04 16:33:58 +0200519
Derek Allard2067d1a2008-11-13 22:59:24 +0000520 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200521
Derek Allard2067d1a2008-11-13 22:59:24 +0000522 /**
523 * Test for a particular language
524 *
525 * @access public
526 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200527 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000528 public function accept_lang($lang = 'en')
Derek Allard2067d1a2008-11-13 22:59:24 +0000529 {
Phil Sturgeondac1b462011-01-06 17:40:10 +0000530 return (in_array(strtolower($lang), $this->languages(), TRUE));
Derek Allard2067d1a2008-11-13 22:59:24 +0000531 }
Barry Mienydd671972010-10-04 16:33:58 +0200532
Derek Allard2067d1a2008-11-13 22:59:24 +0000533 // --------------------------------------------------------------------
Barry Mienydd671972010-10-04 16:33:58 +0200534
Derek Allard2067d1a2008-11-13 22:59:24 +0000535 /**
536 * Test for a particular character set
537 *
538 * @access public
539 * @return bool
Barry Mienydd671972010-10-04 16:33:58 +0200540 */
Phil Sturgeondac1b462011-01-06 17:40:10 +0000541 public function accept_charset($charset = 'utf-8')
Derek Allard2067d1a2008-11-13 22:59:24 +0000542 {
Phil Sturgeondac1b462011-01-06 17:40:10 +0000543 return (in_array(strtolower($charset), $this->charsets(), TRUE));
Derek Allard2067d1a2008-11-13 22:59:24 +0000544 }
Barry Mienydd671972010-10-04 16:33:58 +0200545
Derek Allard2067d1a2008-11-13 22:59:24 +0000546}
547
548
549/* End of file User_agent.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000550/* Location: ./system/libraries/User_agent.php */