Add CI_User_agent::parse() to allow parsing a custom user-agent string

Based on PR #970
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php
index e13bf85..3a6b6bc 100644
--- a/system/libraries/User_agent.php
+++ b/system/libraries/User_agent.php
@@ -634,6 +634,34 @@
 		return in_array(strtolower($charset), $this->charsets(), TRUE);
 	}
 
+	// --------------------------------------------------------------------
+
+	/**
+	 * Parse a custom user-agent string
+	 *
+	 * @param	string	$string
+	 * @return	void
+	 */
+	public function parse($string)
+	{
+		// Reset values
+		$this->is_browser = FALSE;
+		$this->is_robot = FALSE;
+		$this->is_mobile = FALSE;
+		$this->browser = '';
+		$this->version = '';
+		$this->mobile = '';
+		$this->robot = '';
+
+		// Set the new user-agent string and parse it, unless empty
+		$this->agent = $string;
+
+		if ( ! empty($string))
+		{
+			$this->_compile_data();
+		}
+	}
+
 }
 
 /* End of file User_agent.php */