From 8850e37c3b5a8639033371a302f949c758de89fa Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 27 Feb 2014 21:56:06 +0200 Subject: Add parameter to CI_Input::user_agent() --- system/core/Input.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'system/core') 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 @@ -46,13 +46,6 @@ class CI_Input { */ public $ip_address = FALSE; - /** - * User agent string - * - * @var string - */ - public $user_agent = FALSE; - /** * Allow GET array flag * @@ -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); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b