summaryrefslogtreecommitdiffstats
path: root/system/core/Input.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-27 20:56:06 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-27 20:56:06 +0100
commit8850e37c3b5a8639033371a302f949c758de89fa (patch)
tree6c83992bf41751cd55818d546d3de23dcdba0629 /system/core/Input.php
parent7e96351e4e420ff92eae4904826a49c14ebec7c0 (diff)
Add parameter to CI_Input::user_agent()
Diffstat (limited to 'system/core/Input.php')
-rw-r--r--system/core/Input.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 620e50f63..1408da2cb 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -47,13 +47,6 @@ class CI_Input {
public $ip_address = FALSE;
/**
- * User agent string
- *
- * @var string
- */
- public $user_agent = FALSE;
-
- /**
* Allow GET array flag
*
* If set to FALSE, then $_GET will be set to an empty array.
@@ -553,14 +546,9 @@ class CI_Input {
*
* @return string|null User Agent string or NULL if it doesn't exist
*/
- public function user_agent()
+ public function user_agent($xss_clean = NULL)
{
- if ($this->user_agent !== FALSE)
- {
- return $this->user_agent;
- }
-
- return $this->user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : NULL;
+ return $this->_fetch_from_array($_SERVER, 'HTTP_USER_AGENT', $xss_clean);
}
// --------------------------------------------------------------------