Merge remote-tracking branch 'upstream/develop' into develop
diff --git a/system/core/Common.php b/system/core/Common.php
index 7feb16b..c7ab387 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -681,17 +681,22 @@
 		{
 			if ( ! isset($_suhosin_func_blacklist))
 			{
-				$_suhosin_func_blacklist = extension_loaded('suhosin')
-					? array()
-					: explode(',', trim(@ini_get('suhosin.executor.func.blacklist')));
-
-				if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval'))
+				if (extension_loaded('suhosin'))
 				{
-					$_suhosin_func_blacklist[] = 'eval';
+					$_suhosin_func_blacklist = explode(',', trim(@ini_get('suhosin.executor.func.blacklist')));
+
+					if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval'))
+					{
+						$_suhosin_func_blacklist[] = 'eval';
+					}
+				}
+				else
+				{
+					$_suhosin_func_blacklist = array();
 				}
 			}
 
-			return in_array($function_name, $_suhosin_func_blacklist, TRUE);
+			return ! in_array($function_name, $_suhosin_func_blacklist, TRUE);
 		}
 
 		return FALSE;
diff --git a/system/core/Output.php b/system/core/Output.php
index 98deff5..0ba0a57 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -143,7 +143,7 @@
 	 * Sets the output string.
 	 *
 	 * @param	string	$output	Output data
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function set_output($output)
 	{
@@ -159,7 +159,7 @@
 	 * Appends data onto the output string.
 	 *
 	 * @param	string	$output	Data to append
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function append_output($output)
 	{
@@ -187,7 +187,7 @@
 	 *
 	 * @param	string	$header		Header
 	 * @param	bool	$replace	Whether to replace the old header value, if already set
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function set_header($header, $replace = TRUE)
 	{
@@ -211,7 +211,7 @@
 	 *
 	 * @param	string	$mime_type	Extension of the file we're outputting
 	 * @param	string	$charset	Character set (default: NULL)
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function set_content_type($mime_type, $charset = NULL)
 	{
@@ -308,7 +308,7 @@
 	 *
 	 * @param	int	$code	Status code (default: 200)
 	 * @param	string	$text	Optional message
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function set_status_header($code = 200, $text = '')
 	{
@@ -322,7 +322,7 @@
 	 * Enable/disable Profiler
 	 *
 	 * @param	bool	$val	TRUE to enable or FALSE to disable
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function enable_profiler($val = TRUE)
 	{
@@ -339,7 +339,7 @@
 	 * Profiler section display.
 	 *
 	 * @param	array	$sections	Profiler sections
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function set_profiler_sections($sections)
 	{
@@ -363,7 +363,7 @@
 	 * Set Cache
 	 *
 	 * @param	int	$time	Cache expiration time in seconds
-	 * @return	object	$this
+	 * @return	CI_Output
 	 */
 	public function cache($time)
 	{
@@ -780,6 +780,7 @@
 			break;
 
 			case 'text/css':
+			case 'text/javascript':
 
 				//Remove CSS comments
 				$output = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $output);
@@ -788,11 +789,12 @@
 				// semi-colons, parenthesis, commas
 				$output = preg_replace('!\s*(:|;|,|}|{|\(|\))\s*!', '$1', $output);
 
-			break;
+				// Remove spaces
+			        $output =  preg_replace('/  /s', ' ', $output);
 
-			case 'text/javascript':
+			        // Remove breaklines and tabs
+			        $output =  preg_replace('/[\r\n\t]/', '', $output);
 
-				// Currently leaves JavaScript untouched.
 			break;
 
 			default: break;
diff --git a/system/core/Security.php b/system/core/Security.php
index 70e9e97..8c70e85 100644
--- a/system/core/Security.php
+++ b/system/core/Security.php
@@ -151,7 +151,7 @@
 	/**
 	 * CSRF Verify
 	 *
-	 * @return	object
+	 * @return	CI_Security
 	 */
 	public function csrf_verify()
 	{
@@ -202,7 +202,7 @@
 	 * CSRF Set Cookie
 	 *
 	 * @codeCoverageIgnore
-	 * @return	object
+	 * @return	CI_Security
 	 */
 	public function csrf_set_cookie()
 	{
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php
index 59c3baf..5c782f8 100644
--- a/system/database/DB_forge.php
+++ b/system/database/DB_forge.php
@@ -229,7 +229,7 @@
 	 *
 	 * @param	string	$key
 	 * @param	bool	$primary
-	 * @return	object
+	 * @return	CI_DB_forge
 	 */
 	public function add_key($key = '', $primary = FALSE)
 	{
@@ -266,7 +266,7 @@
 	 * Add Field
 	 *
 	 * @param	array	$field
-	 * @return	object
+	 * @return	CI_DB_forge
 	 */
 	public function add_field($field = '')
 	{
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index b0e86ed..1aa73ba 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -254,7 +254,7 @@
 	 *
 	 * @param	string
 	 * @param	mixed
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function select($select = '*', $escape = NULL)
 	{
@@ -296,7 +296,7 @@
 	 *
 	 * @param	string	the field
 	 * @param	string	an alias
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function select_max($select = '', $alias = '')
 	{
@@ -312,7 +312,7 @@
 	 *
 	 * @param	string	the field
 	 * @param	string	an alias
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function select_min($select = '', $alias = '')
 	{
@@ -328,7 +328,7 @@
 	 *
 	 * @param	string	the field
 	 * @param	string	an alias
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function select_avg($select = '', $alias = '')
 	{
@@ -344,7 +344,7 @@
 	 *
 	 * @param	string	the field
 	 * @param	string	an alias
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function select_sum($select = '', $alias = '')
 	{
@@ -364,7 +364,7 @@
 	 * @param	string	$select	Field name
 	 * @param	string	$alias
 	 * @param	string	$type
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	protected function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX')
 	{
@@ -426,7 +426,7 @@
 	 * Sets a flag which tells the query string compiler to add DISTINCT
 	 *
 	 * @param	bool	$val
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function distinct($val = TRUE)
 	{
@@ -442,7 +442,7 @@
 	 * Generates the FROM portion of the query
 	 *
 	 * @param	mixed	$from	can be a string or array
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function from($from)
 	{
@@ -496,7 +496,7 @@
 	 * @param	string	the join condition
 	 * @param	string	the type of join
 	 * @param	string	whether not to try to escape identifiers
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function join($table, $cond, $type = '', $escape = NULL)
 	{
@@ -584,7 +584,7 @@
 	 * @param	mixed
 	 * @param	mixed
 	 * @param	bool
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function where($key, $value = NULL, $escape = NULL)
 	{
@@ -602,7 +602,7 @@
 	 * @param	mixed
 	 * @param	mixed
 	 * @param	bool
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function or_where($key, $value = NULL, $escape = NULL)
 	{
@@ -624,7 +624,7 @@
 	 * @param	mixed	$value
 	 * @param	string	$type
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = NULL)
 	{
@@ -685,7 +685,7 @@
 	 * @param	string	$key	The field to search
 	 * @param	array	$values	The values searched on
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function where_in($key = NULL, $values = NULL, $escape = NULL)
 	{
@@ -703,7 +703,7 @@
 	 * @param	string	$key	The field to search
 	 * @param	array	$values	The values searched on
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function or_where_in($key = NULL, $values = NULL, $escape = NULL)
 	{
@@ -721,7 +721,7 @@
 	 * @param	string	$key	The field to search
 	 * @param	array	$values	The values searched on
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function where_not_in($key = NULL, $values = NULL, $escape = NULL)
 	{
@@ -739,7 +739,7 @@
 	 * @param	string	$key	The field to search
 	 * @param	array	$values	The values searched on
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function or_where_not_in($key = NULL, $values = NULL, $escape = NULL)
 	{
@@ -761,7 +761,7 @@
 	 * @param	bool	$not	If the statement would be IN or NOT IN
 	 * @param	string	$type
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	protected function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ', $escape = NULL)
 	{
@@ -813,7 +813,7 @@
 	 * @param	string	$match
 	 * @param	string	$side
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function like($field, $match = '', $side = 'both', $escape = NULL)
 	{
@@ -832,7 +832,7 @@
 	 * @param	string	$match
 	 * @param	string	$side
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function not_like($field, $match = '', $side = 'both', $escape = NULL)
 	{
@@ -851,7 +851,7 @@
 	 * @param	string	$match
 	 * @param	string	$side
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function or_like($field, $match = '', $side = 'both', $escape = NULL)
 	{
@@ -870,7 +870,7 @@
 	 * @param	string	$match
 	 * @param	string	$side
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function or_not_like($field, $match = '', $side = 'both', $escape = NULL)
 	{
@@ -893,7 +893,7 @@
 	 * @param	string	$side
 	 * @param	string	$not
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '', $escape = NULL)
 	{
@@ -952,7 +952,7 @@
 	 *
 	 * @param	string	$not	(Internal use only)
 	 * @param	string	$type	(Internal use only)
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function group_start($not = '', $type = 'AND ')
 	{
@@ -979,7 +979,7 @@
 	/**
 	 * Starts a query group, but ORs the group
 	 *
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function or_group_start()
 	{
@@ -991,7 +991,7 @@
 	/**
 	 * Starts a query group, but NOTs the group
 	 *
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function not_group_start()
 	{
@@ -1003,7 +1003,7 @@
 	/**
 	 * Starts a query group, but OR NOTs the group
 	 *
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function or_not_group_start()
 	{
@@ -1015,7 +1015,7 @@
 	/**
 	 * Ends a query group
 	 *
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function group_end()
 	{
@@ -1065,7 +1065,7 @@
 	 *
 	 * @param	string	$by
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function group_by($by, $escape = NULL)
 	{
@@ -1140,7 +1140,7 @@
 	 * @param	string	$orderby
 	 * @param	string	$direction	ASC or DESC
 	 * @param	bool	$escape
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function order_by($orderby, $direction = '', $escape = NULL)
 	{
@@ -1198,7 +1198,7 @@
 	 *
 	 * @param	int	$value	LIMIT value
 	 * @param	int	$offset	OFFSET value
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function limit($value, $offset = FALSE)
 	{
@@ -1214,7 +1214,7 @@
 	 * Sets the OFFSET value
 	 *
 	 * @param	int	$offset	OFFSET value
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function offset($offset)
 	{
@@ -1247,7 +1247,7 @@
 	 * @param	mixed
 	 * @param	string
 	 * @param	bool
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function set($key, $value = '', $escape = NULL)
 	{
@@ -1469,7 +1469,7 @@
 	 * @param	mixed
 	 * @param	string
 	 * @param	bool
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function set_insert_batch($key, $value = '', $escape = NULL)
 	{
@@ -1860,7 +1860,7 @@
 	 * @param	array
 	 * @param	string
 	 * @param	bool
-	 * @return	object
+	 * @return	CI_DB_query_builder
 	 */
 	public function set_update_batch($key, $index = '', $escape = NULL)
 	{
diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php
index 2a737c5..db1ce5f 100644
--- a/system/database/drivers/cubrid/cubrid_forge.php
+++ b/system/database/drivers/cubrid/cubrid_forge.php
@@ -109,7 +109,7 @@
 			else
 			{
 				$alter_type = empty($field[$i]['new_name']) ? ' MODIFY ' : ' CHANGE ';
-				$sqls[] = $sql.$alter_type$this->_process_column($field[$i]);
+				$sqls[] = $sql.$alter_type.$this->_process_column($field[$i]);
 			}
 		}
 
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index 8788f5d..a809f1f 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -26,32 +26,32 @@
  */
 defined('BASEPATH') OR exit('No direct script access allowed');
 
-$lang['required']				= 'The %s field is required.';
-$lang['isset']					= 'The %s field must have a value.';
-$lang['valid_email']			= 'The %s field must contain a valid email address.';
-$lang['valid_emails']			= 'The %s field must contain all valid email addresses.';
-$lang['valid_url']				= 'The %s field must contain a valid URL.';
-$lang['valid_ip']				= 'The %s field must contain a valid IP.';
-$lang['min_length']				= 'The %s field must be at least %s characters in length.';
-$lang['max_length']				= 'The %s field cannot exceed %s characters in length.';
-$lang['exact_length']			= 'The %s field must be exactly %s characters in length.';
-$lang['alpha']					= 'The %s field may only contain alphabetical characters.';
-$lang['alpha_numeric']			= 'The %s field may only contain alpha-numeric characters.';
-$lang['alpha_dash']				= 'The %s field may only contain alpha-numeric characters, underscores, and dashes.';
-$lang['numeric']				= 'The %s field must contain only numbers.';
-$lang['is_numeric']				= 'The %s field must contain only numeric characters.';
-$lang['integer']				= 'The %s field must contain an integer.';
-$lang['regex_match']			= 'The %s field is not in the correct format.';
-$lang['matches']				= 'The %s field does not match the %s field.';
-$lang['differs']				= 'The %s field must differ from the %s field.';
-$lang['is_unique'] 				= 'The %s field must contain a unique value.';
-$lang['is_natural']				= 'The %s field must only contain digits.';
-$lang['is_natural_no_zero']		= 'The %s field must only contain digits and must be greater than zero.';
-$lang['decimal']				= 'The %s field must contain a decimal number.';
-$lang['less_than']				= 'The %s field must contain a number less than %s.';
-$lang['less_than_equal_to']		= 'The %s field must contain a number less than or equal to %s.';
-$lang['greater_than']			= 'The %s field must contain a number greater than %s.';
-$lang['greater_than_equal_to']	= 'The %s field must contain a number greater than or equal to %s.';
+$lang['form_validation_required']		= 'The {field} field is required.';
+$lang['form_validation_isset']			= 'The {field} field must have a value.';
+$lang['form_validation_valid_email']		= 'The {field} field must contain a valid email address.';
+$lang['form_validation_valid_emails']		= 'The {field} field must contain all valid email addresses.';
+$lang['form_validation_valid_url']		= 'The {field} field must contain a valid URL.';
+$lang['form_validation_valid_ip']		= 'The {field} field must contain a valid IP.';
+$lang['form_validation_min_length']		= 'The {field} field must be at least {param} characters in length.';
+$lang['form_validation_max_length']		= 'The {field} field cannot exceed {param} characters in length.';
+$lang['form_validation_exact_length']		= 'The {field} field must be exactly {param} characters in length.';
+$lang['form_validation_alpha']			= 'The {field} field may only contain alphabetical characters.';
+$lang['form_validation_alpha_numeric']		= 'The {field} field may only contain alpha-numeric characters.';
+$lang['form_validation_alpha_dash']		= 'The {field} field may only contain alpha-numeric characters, underscores, and dashes.';
+$lang['form_validation_numeric']		= 'The {field} field must contain only numbers.';
+$lang['form_validation_is_numeric']		= 'The {field} field must contain only numeric characters.';
+$lang['form_validation_integer']		= 'The {field} field must contain an integer.';
+$lang['form_validation_regex_match']		= 'The {field} field is not in the correct format.';
+$lang['form_validation_matches']		= 'The {field} field does not match the {param} field.';
+$lang['form_validation_differs']		= 'The {field} field must differ from the {param} field.';
+$lang['form_validation_is_unique'] 		= 'The {field} field must contain a unique value.';
+$lang['form_validation_is_natural']		= 'The {field} field must only contain digits.';
+$lang['form_validation_is_natural_no_zero']	= 'The {field} field must only contain digits and must be greater than zero.';
+$lang['form_validation_decimal']		= 'The {field} field must contain a decimal number.';
+$lang['form_validation_less_than']		= 'The {field} field must contain a number less than {param}.';
+$lang['form_validation_less_than_equal_to']	= 'The {field} field must contain a number less than or equal to {param}.';
+$lang['form_validation_greater_than']		= 'The {field} field must contain a number greater than {param}.';
+$lang['form_validation_greater_than_equal_to']	= 'The {field} field must contain a number greater than or equal to {param}.';
 
 /* End of file form_validation_lang.php */
 /* Location: ./system/language/english/form_validation_lang.php */
\ No newline at end of file
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 5d8fc8a..365a8bc 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -406,7 +406,7 @@
 	 * Initialize preferences
 	 *
 	 * @param	array
-	 * @return	void
+	 * @return	CI_Email
 	 */
 	public function initialize($config = array())
 	{
@@ -440,7 +440,7 @@
 	 * Initialize the Email Data
 	 *
 	 * @param	bool
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function clear($clear_attachments = FALSE)
 	{
@@ -474,7 +474,7 @@
 	 * @param	string	$from
 	 * @param	string	$name
 	 * @param	string	$return_path = NULL	Return-Path
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function from($from, $name = '', $return_path = NULL)
 	{
@@ -522,7 +522,7 @@
 	 *
 	 * @param	string
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function reply_to($replyto, $name = '')
 	{
@@ -558,7 +558,7 @@
 	 * Set Recipients
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function to($to)
 	{
@@ -586,7 +586,7 @@
 	 * Set CC
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function cc($cc)
 	{
@@ -614,7 +614,7 @@
 	 *
 	 * @param	string
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function bcc($bcc, $limit = '')
 	{
@@ -649,7 +649,7 @@
 	 * Set Email Subject
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function subject($subject)
 	{
@@ -664,7 +664,7 @@
 	 * Set Body
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function message($body)
 	{
@@ -693,7 +693,7 @@
 	 * @param	string	$disposition = 'attachment'
 	 * @param	string	$newname = NULL
 	 * @param	string	$mime = ''
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function attach($filename, $disposition = '', $newname = NULL, $mime = '')
 	{
@@ -746,7 +746,7 @@
 	 * Set Multipart Value
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function set_alt_message($str = '')
 	{
@@ -760,7 +760,7 @@
 	 * Set Mailtype
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function set_mailtype($type = 'text')
 	{
@@ -774,7 +774,7 @@
 	 * Set Wordwrap
 	 *
 	 * @param	bool
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function set_wordwrap($wordwrap = TRUE)
 	{
@@ -788,7 +788,7 @@
 	 * Set Protocol
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function set_protocol($protocol = 'mail')
 	{
@@ -802,7 +802,7 @@
 	 * Set Priority
 	 *
 	 * @param	int
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function set_priority($n = 3)
 	{
@@ -816,7 +816,7 @@
 	 * Set Newline Character
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function set_newline($newline = "\n")
 	{
@@ -830,7 +830,7 @@
 	 * Set CRLF
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Email
 	 */
 	public function set_crlf($crlf = "\n")
 	{
diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php
index cdb0a64..e54ce49 100644
--- a/system/libraries/Encrypt.php
+++ b/system/libraries/Encrypt.php
@@ -122,7 +122,7 @@
 	 * Set the encryption key
 	 *
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Encrypt
 	 */
 	public function set_key($key = '')
 	{
@@ -419,7 +419,7 @@
 	 * Set the Mcrypt Cipher
 	 *
 	 * @param	int
-	 * @return	object
+	 * @return	CI_Encrypt
 	 */
 	public function set_cipher($cipher)
 	{
@@ -433,7 +433,7 @@
 	 * Set the Mcrypt Mode
 	 *
 	 * @param	int
-	 * @return	object
+	 * @return	CI_Encrypt
 	 */
 	public function set_mode($mode)
 	{
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index e4eac04..32f7da1 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -149,7 +149,7 @@
 	 * @param	mixed	$field
 	 * @param	string	$label
 	 * @param	mixed	$rules
-	 * @return	object
+	 * @return	CI_Form_validation
 	 */
 	public function set_rules($field, $label = '', $rules = '')
 	{
@@ -266,7 +266,7 @@
 	 *
 	 * @param	array
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Form_validation
 	 */
 	public function set_message($lang, $val = '')
 	{
@@ -288,7 +288,7 @@
 	 *
 	 * @param	string
 	 * @param	string
-	 * @return	object
+	 * @return	CI_Form_validation
 	 */
 	public function set_error_delimiters($prefix = '<p>', $suffix = '</p>')
 	{
@@ -609,13 +609,15 @@
 				{
 					$line = $this->_error_messages[$type];
 				}
-				elseif (FALSE === ($line = $this->CI->lang->line($type)))
+				elseif (FALSE === ($line = $this->CI->lang->line('form_validation_'.$type))
+					// DEPRECATED support for non-prefixed keys
+					&& FALSE === ($line = $this->CI->lang->line($type, FALSE)))
 				{
 					$line = 'The field was not set';
 				}
 
 				// Build the error message
-				$message = sprintf($line, $this->_translate_fieldname($row['label']));
+				$message = $this->_build_error_msg($line, $this->_translate_fieldname($row['label']));
 
 				// Save the error message
 				$this->_field_data[$row['field']]['error'] = $message;
@@ -749,7 +751,9 @@
 			{
 				if ( ! isset($this->_error_messages[$rule]))
 				{
-					if (FALSE === ($line = $this->CI->lang->line($rule)))
+					if (FALSE === ($line = $this->CI->lang->line('form_validation_'.$rule))
+						// DEPRECATED support for non-prefixed keys
+						&& FALSE === ($line = $this->CI->lang->line($rule, FALSE)))
 					{
 						$line = 'Unable to access an error message corresponding to your field name.';
 					}
@@ -767,7 +771,7 @@
 				}
 
 				// Build the error message
-				$message = sprintf($line, $this->_translate_fieldname($row['label']), $param);
+				$message = $this->_build_error_msg($line, $this->_translate_fieldname($row['label']), $param);
 
 				// Save the error message
 				$this->_field_data[$row['field']]['error'] = $message;
@@ -797,7 +801,9 @@
 		if (sscanf($fieldname, 'lang:%s', $line) === 1)
 		{
 			// Were we able to translate the field name?  If not we use $line
-			if (FALSE === ($fieldname = $this->CI->lang->line($line)))
+			if (FALSE === ($fieldname = $this->CI->lang->line('form_validation_'.$line))
+				// DEPRECATED support for non-prefixed keys
+				&& FALSE === ($fieldname = $this->CI->lang->line($line, FALSE)))
 			{
 				return $line;
 			}
@@ -809,6 +815,27 @@
 	// --------------------------------------------------------------------
 
 	/**
+	 * Build an error message using the field and param.
+	 *
+	 * @param	string	The error message line
+	 * @param	string	A field's human name
+	 * @param	mixed	A rule's optional parameter
+	 * @return	string
+	 */
+	protected function _build_error_msg($line, $field = '', $param = '')
+	{
+		// Check for %s in the string for legacy support.
+		if (strpos($line, '%s') !== FALSE)
+		{
+			return sprintf($line, $field, $param);
+		}
+
+		return str_replace(array('{field}', '{param}'), array($field, $param), $line);
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
 	 * Get the value from a form
 	 *
 	 * Permits you to repopulate a form field with the value it was submitted
diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php
index 6d926ae..9392a4d 100644
--- a/system/libraries/Session/drivers/Session_cookie.php
+++ b/system/libraries/Session/drivers/Session_cookie.php
@@ -457,7 +457,7 @@
 			}
 
 			// No result? Kill it!
-			if ($query->num_rows() === 0)
+			if (empty($query) OR $query->num_rows() === 0)
 			{
 				$this->sess_destroy();
 				return FALSE;
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 9ecd0de..740e99c 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -133,7 +133,7 @@
 	protected function _get_mod_time($dir)
 	{
 		// filemtime() may return false, but raises an error for non-existing files
-		$date = file_exists($dir) ? filemtime($dir) : getdate($this->now);
+		$date = file_exists($dir) ? @filemtime($dir) : getdate($this->now);
 
 		return array(
 				'file_mtime' => ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2,
@@ -438,7 +438,7 @@
 	 * Lets you clear current zip data. Useful if you need to create
 	 * multiple zips with different data.
 	 *
-	 * @return	object
+	 * @return	CI_Zip
 	 */
 	public function clear_data()
 	{
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index daf7965..a3d2905 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -73,7 +73,7 @@
 	 - Added JS window name support to the :php:func:`anchor_popup()` function.
 	 - Added support (auto-detection) for HTTP/1.1 response code 303 in :php:func:`redirect()`.
 	 - Changed :php:func:`redirect()` to only choose the **refresh** method only on IIS servers, instead of all servers on Windows (when **auto** is used).
-	 - Changed :php:func:`anchor()`, :php:func:`anchor_popup()`, and :php:func:`redirect()` to support protocol-relative URLs, such as `redirect('//ellislab.com/codeigniter')`.
+	 - Changed :php:func:`anchor()`, :php:func:`anchor_popup()`, and :php:func:`redirect()` to support protocol-relative URLs (e.g. *//ellislab.com/codeigniter*).
    -  Added XHTML Basic 1.1 doctype to :doc:`HTML Helper <helpers/html_helper>`.
    -  :doc:`Inflector Helper <helpers/inflector_helper>` changes include:
 	 - Changed :php:func:`humanize()` to allow passing an input separator as its second parameter.
@@ -225,13 +225,15 @@
 	 -  Added method ``set_data()`` to set an alternative data array to be validated instead of the default ``$_POST``.
 	 -  Added method ``reset_validation()`` which resets internal validation variables in case of multiple validation routines.
 	 -  Added support for setting error delimiters in the config file via ``$config['error_prefix']`` and ``$config['error_suffix']``.
-	 -  ``_execute()`` now considers input data to be invalid if a specified rule is not found.
+	 -  Internal method ``_execute()`` now considers input data to be invalid if a specified rule is not found.
 	 -  Removed method ``is_numeric()`` as it exists as a native PHP function and ``_execute()`` will find and use that (the **is_numeric** rule itself is deprecated since 1.6.1).
 	 -  Native PHP functions used as rules can now accept an additional parameter, other than the data itself.
-	 -  Updated ``set_rules()`` to accept an array of rules as well as a string.
+	 -  Updated method ``set_rules()`` to accept an array of rules as well as a string.
 	 -  Fields that have empty rules set no longer run through validation (and therefore are not considered erroneous).
 	 -  Added rule **differs* to check if the value of a field differs from the value of another field.
 	 -  Added rule **valid_url**.
+	 -  Added support for named parameters in error messages.
+	 -  :doc:`Language <libraries/language>` line keys must now be prefixed with **form_validation_**.
    -  Added support for setting :doc:`Table <libraries/table>` class defaults in a config file.
    -  :doc:`Caching Library <libraries/caching>` changes include:
 	 -  Added Wincache driver.
@@ -325,9 +327,9 @@
 -  Fixed a bug (#181) where a mis-spelling was in the form validation language file.
 -  Fixed a bug (#159, #163) that mishandled Query Builder nested transactions because _trans_depth was not getting incremented.
 -  Fixed a bug (#737, #75) - :doc:`Pagination <libraries/pagination>` anchor class was not set properly when using initialize method.
--  Fixed a bug (#419) - auto_link() now recognizes URLs that come after a word boundary.
--  Fixed a bug (#724) - is_unique in form validation now checks that you are connected to a database.
--  Fixed a bug (#647) - _get_mod_time() in Zip library no longer generates stat failed errors.
+-  Fixed a bug (#419) - ``auto_link()`` now recognizes URLs that come after a word boundary.
+-  Fixed a bug (#724) - :doc:`Form Validation Library <libraries/form_validation>` rule **is_unique** didn't check if a database connection exists.
+-  Fixed a bug (#647) - :doc:`Zip Library <libraries/zip>` internal method ``_get_mod_time()`` didn't suppress possible "stat failed" errors generated by ``filemtime()``.
 -  Fixed a bug (#608) - Fixes an issue with the Image_lib class not clearing properties completely.
 -  Fixed a bug (#157, #174) - the Image_lib clear() function now resets all variables to their default values.
 -  Fixed a bug where using $this->dbforge->create_table() with PostgreSQL database could lead to fetching whole table.
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
index ef5fbdf..ff60186 100644
--- a/user_guide_src/source/installation/upgrade_300.rst
+++ b/user_guide_src/source/installation/upgrade_300.rst
@@ -138,7 +138,7 @@
 Step 11: Change usage of Email library with multiple emails
 ***********************************************************
 
-The :doc:`Email library <../libraries/email>` will automatically clear the
+The :doc:`Email Library <../libraries/email>` will automatically clear the
 set parameters after successfully sending emails. To override this behaviour,
 pass FALSE as the first parameter in the ``send()`` method:
 
@@ -149,13 +149,43 @@
  		// Parameters won't be cleared
  	}
 
+***************************************************
+Step 12: Update your Form_validation language lines
+***************************************************
+
+Two improvements have been made to the :doc:`Form Validation Library
+<../libraries/form_validation>`'s :doc:`language <../libraries/language>`
+files and error messages format:
+
+ - :doc:`Language Library <../libraries/language>` line keys now must be
+   prefixed with **form_validation_** in order to avoid collisions::
+
+	// Old
+	$lang['rule'] = ...
+
+	// New
+	$lang['form_validation_rule'] = ...
+
+ - The error messages format has been changed to use named parameters, to
+   allow more flexibility than what `sprintf()` offers::
+
+	// Old
+	'The %s field does not match the %s field.'
+
+	// New
+	'The {field} field does not match the {param} field.'
+
+.. note:: The old formatting still works, but the non-prefixed line keys
+	are DEPRECATED and scheduled for removal in CodeIgniter 3.1+.
+	Therefore you're encouraged to update its usage sooner rather than
+	later.
 
 ****************************************************************
-Step 12: Remove usage of (previously) deprecated functionalities
+Step 13: Remove usage of (previously) deprecated functionalities
 ****************************************************************
 
-In addition to the ``$autoload['core']`` configuration setting, there's a number of other functionalities
-that have been removed in CodeIgniter 3.0.0:
+In addition to the ``$autoload['core']`` configuration setting, there's a
+number of other functionalities that have been removed in CodeIgniter 3.0.0:
 
 The SHA1 library
 ================
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
index 7478ca0..fbe540c 100644
--- a/user_guide_src/source/libraries/form_validation.rst
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -53,7 +53,7 @@
 #. A :doc:`View <../general/views>` file containing a form.
 #. A View file containing a "success" message to be displayed upon
    successful submission.
-#. A :doc:`controller <../general/controllers>` function to receive and
+#. A :doc:`controller <../general/controllers>` method to receive and
    process the submitted data.
 
 Let's create those three things, using a member sign-up form as the
@@ -139,7 +139,6 @@
 			}
 		}
 	}
-	?>
 
 Try it!
 =======
@@ -152,7 +151,7 @@
 because you haven't set up any validation rules yet.
 
 **Since you haven't told the Form Validation class to validate anything
-yet, it returns FALSE (boolean false) by default. The run() function
+yet, it returns FALSE (boolean false) by default. ``The run()`` method
 only returns TRUE if it has successfully applied your rules without any
 of them failing.**
 
@@ -176,7 +175,7 @@
    This function will return any error messages sent back by the
    validator. If there are no messages it returns an empty string.
 
-The controller (form.php) has one function: index(). This function
+The controller (form.php) has one method: ``index()``. This method
 initializes the validation class and loads the form helper and URL
 helper used by your view files. It also runs the validation routine.
 Based on whether the validation was successful it either presents the
@@ -190,11 +189,11 @@
 CodeIgniter lets you set as many validation rules as you need for a
 given field, cascading them in order, and it even lets you prep and
 pre-process the field data at the same time. To set validation rules you
-will use the set_rules() function::
+will use the ``set_rules()`` method::
 
 	$this->form_validation->set_rules();
 
-The above function takes **three** parameters as input:
+The above method takes **three** parameters as input:
 
 #. The field name - the exact name you've given the form field.
 #. A "human" name for this field, which will be inserted into the error
@@ -202,11 +201,11 @@
    a human name of "Username".
 #. The validation rules for this form field.
 
-.. note:: If you would like the field
-	name to be stored in a language file, please see :ref:`translating-field-names`.
+.. note:: If you would like the field name to be stored in a language
+	file, please see :ref:`translating-field-names`.
 
 Here is an example. In your controller (form.php), add this code just
-below the validation initialization function::
+below the validation initialization method::
 
 	$this->form_validation->set_rules('username', 'Username', 'required');
 	$this->form_validation->set_rules('password', 'Password', 'required');
@@ -240,7 +239,6 @@
 			}
 		}
 	}
-	?>
 
 Now submit the form with the fields blank and you should see the error
 messages. If you submit the form with all the fields populated you'll
@@ -252,7 +250,7 @@
 Setting Rules Using an Array
 ============================
 
-Before moving on it should be noted that the rule setting function can
+Before moving on it should be noted that the rule setting method can
 be passed an array if you prefer to set all your rules in one action. If
 you use this approach, you must name your array keys as indicated::
 
@@ -285,7 +283,7 @@
 ===============
 
 CodeIgniter lets you pipe multiple rules together. Let's try it. Change
-your rules in the third parameter of rule setting function, like this::
+your rules in the third parameter of rule setting method, like this::
 
 	$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|is_unique[users.username]');
 	$this->form_validation->set_rules('password', 'Password', 'required');
@@ -303,14 +301,15 @@
 new error messages that correspond to your new rules. There are numerous
 rules available which you can read about in the validation reference.
 
-.. note:: You can also pass an array of rules to set_rules(), instead of a string. Example::
+.. note:: You can also pass an array of rules to ``set_rules()``,
+	instead of a string. Example::
 
 	$this->form_validation->set_rules('username', 'Username', array('required', 'min_length[5]'));
 
 Prepping Data
 =============
 
-In addition to the validation functions like the ones we used above, you
+In addition to the validation method like the ones we used above, you
 can also prep your data in various ways. For example, you can set up
 rules like this::
 
@@ -320,15 +319,15 @@
 	$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
 
 In the above example, we are "trimming" the fields, converting the
-password to MD5, and running the username through the "xss_clean"
-function, which removes malicious data.
+password to MD5, and running the username through the `xss_clean()`
+method, which removes malicious data.
 
 **Any native PHP function that accepts one parameter can be used as a
 rule, like htmlspecialchars, trim, md5, etc.**
 
 .. note:: You will generally want to use the prepping functions
-	**after** the validation rules so if there is an error, the original
-	data will be shown in the form.
+	**after** the validation rules so if there is an error, the
+	original data will be shown in the form.
 
 Re-populating the form
 ======================
@@ -341,9 +340,9 @@
 	set_value('field name')
 
 Open your myform.php view file and update the **value** in each field
-using the set_value() function:
+using the ``set_value()`` function:
 
-**Don't forget to include each field name in the set_value()
+**Don't forget to include each field name in the ``set_value()``
 functions!**
 
 ::
@@ -380,9 +379,9 @@
 Now reload your page and submit the form so that it triggers an error.
 Your form fields should now be re-populated
 
-.. note:: The :ref:`function-reference` section below
-	contains functions that permit you to re-populate <select> menus, radio
-	buttons, and checkboxes.
+.. note:: The :ref:`class-reference` section below
+	contains functions that permit you to re-populate <select> menus,
+	radio buttons, and checkboxes.
 
 **Important Note:** If you use an array as the name of a form field, you
 must supply it as an array to the function. Example::
@@ -391,20 +390,20 @@
 
 For more info please see the :ref:`using-arrays-as-field-names` section below.
 
-Callbacks: Your own Validation Functions
-========================================
+Callbacks: Your own Validation Methods
+======================================
 
 The validation system supports callbacks to your own validation
-functions. This permits you to extend the validation class to meet your
+methods. This permits you to extend the validation class to meet your
 needs. For example, if you need to run a database query to see if the
-user is choosing a unique username, you can create a callback function
+user is choosing a unique username, you can create a callback method
 that does that. Let's create an example of this.
 
 In your controller, change the "username" rule to this::
 
 	$this->form_validation->set_rules('username', 'Username', 'callback_username_check');
 
-Then add a new function called username_check to your controller.
+Then add a new method called ``username_check()`` to your controller.
 Here's how your controller should now look::
 
 	<?php
@@ -432,11 +431,11 @@
 			}
 		}
 
-		public function username_check($str)
+		protected function username_check($str)
 		{
 			if ($str == 'test')
 			{
-				$this->form_validation->set_message('username_check', 'The %s field can not be the word "test"');
+				$this->form_validation->set_message('username_check', 'The {field} field can not be the word "test"');
 				return FALSE;
 			}
 			else
@@ -446,17 +445,16 @@
 		}
 
 	}
-	?>
 
 Reload your form and submit it with the word "test" as the username. You
-can see that the form field data was passed to your callback function
+can see that the form field data was passed to your callback method
 for you to process.
 
-To invoke a callback just put the function name in a rule, with
+To invoke a callback just put the method name in a rule, with
 "callback\_" as the rule **prefix**. If you need to receive an extra
-parameter in your callback function, just add it normally after the
-function name between square brackets, as in: "callback_foo**[bar]**",
-then it will be passed as the second argument of your callback function.
+parameter in your callback method, just add it normally after the
+method name between square brackets, as in: "callback_foo**[bar]**",
+then it will be passed as the second argument of your callback method.
 
 .. note:: You can also process the form data that is passed to your
 	callback and return it. If your callback returns anything other than a
@@ -469,50 +467,44 @@
 ======================
 
 All of the native error messages are located in the following language
-file: language/english/form_validation_lang.php
+file: **system/language/english/form_validation_lang.php**
 
 To set your own custom message you can either edit that file, or use the
-following function::
+following method::
 
 	$this->form_validation->set_message('rule', 'Error Message');
 
 Where rule corresponds to the name of a particular rule, and Error
 Message is the text you would like displayed.
 
-If you include %s in your error string, it will be replaced with the
-"human" name you used for your field when you set your rules.
+If you'd like to include a field's "human" name, or the optional 
+parameter some rules allow for (such as max_length), you can add the 
+**{field}** and **{param}** tags to your message, respectively.
 
-In the "callback" example above, the error message was set by passing
-the name of the function::
+	$this->form_validation->set_message('min_length', '{field} must have at least {param} characters.');
+
+On a field with the human name Username and a rule of min_length[5], an
+error would display: "Username must have at least 5 characters."
+
+.. note:: The old `sprintf()` method of using **%s** in your error messages
+	will still work, however it will override the tags above. You should
+	use one or the other.
+
+In the callback rule example above, the error message was set by passing
+the name of the method (without the "callback_" prefix)::
 
 	$this->form_validation->set_message('username_check')
 
-If you are using an error message that can accept two $s in your error string,
-such as:
-::
-
-	$this->form_validation->set_message('min_length', 'The $s field must contain at least $s characters.');
-
-Then you can also use %1$s and %2$s:
-::
-
-	$this->form_validation->set_message('min_length', 'This field must contain at least %2$s characters.');
-
-You can also override any error message found in the language file. For
-example, to change the message for the "required" rule you will do this::
-
-	$this->form_validation->set_message('required', 'Your custom message here');
-
 .. _translating-field-names:
 
 Translating Field Names
 =======================
 
 If you would like to store the "human" name you passed to the
-set_rules() function in a language file, and therefore make the name
+``set_rules()`` method in a language file, and therefore make the name
 able to be translated, here's how:
 
-First, prefix your "human" name with lang:, as in this example::
+First, prefix your "human" name with **lang:**, as in this example::
 
 	 $this->form_validation->set_rules('first_name', 'lang:first_name', 'required');
 
@@ -540,7 +532,7 @@
 globally, individually, or change the defaults in a config file.
 
 #. **Changing delimiters Globally**
-   To globally change the error delimiters, in your controller function,
+   To globally change the error delimiters, in your controller method,
    just after loading the Form Validation class, add this::
 
       $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
@@ -567,7 +559,7 @@
 ===========================
 
 If you prefer to show an error message next to each form field, rather
-than as a list, you can use the form_error() function.
+than as a list, you can use the ``form_error()`` function.
 
 Try it! Change your form so that it looks like this::
 
@@ -613,13 +605,14 @@
 
 	$this->form_validation->set_data($data);
 
-Creating validation rules, running the validation and retrieving error messages works the
+Creating validation rules, running the validation, and retrieving error messages works the
 same whether you are validating ``$_POST`` data or an array.
 
-**Important Note:** If you want to validate more than one array during a single execution, then you should	
-call the reset_validation() function before setting up rules and validating the new array.
+.. important:: If you want to validate more than one array during a single
+	execution, then you should call the ``reset_validation()`` method
+	before setting up rules and validating the new array.
 
-For more info please see the :ref:`function-reference` section below.
+For more info please see the :ref:`class-reference` section below.
 
 .. _saving-groups:
 
@@ -630,7 +623,7 @@
 A nice feature of the Form Validation class is that it permits you to
 store all your validation rules for your entire application in a config
 file. You can organize these rules into "groups". These groups can
-either be loaded automatically when a matching controller/function is
+either be loaded automatically when a matching controller/method is
 called, or you can manually call each set as needed.
 
 How to save your rules
@@ -678,56 +671,56 @@
 You can name your rules anything you want::
 
 	$config = array(
-	                 'signup' => array(
-	                                    array(
-	                                            'field' => 'username',
-	                                            'label' => 'Username',
-	                                            'rules' => 'required'
-	                                         ),
-	                                    array(
-	                                            'field' => 'password',
-	                                            'label' => 'Password',
-	                                            'rules' => 'required'
-	                                         ),
-	                                    array(
-	                                            'field' => 'passconf',
-	                                            'label' => 'PasswordConfirmation',
-	                                            'rules' => 'required'
-	                                         ),
-	                                    array(
-	                                            'field' => 'email',
-	                                            'label' => 'Email',
-	                                            'rules' => 'required'
-	                                         )
-	                                    ),
-	                 'email' => array(
-	                                    array(
-	                                            'field' => 'emailaddress',
-	                                            'label' => 'EmailAddress',
-	                                            'rules' => 'required|valid_email'
-	                                         ),
-	                                    array(
-	                                            'field' => 'name',
-	                                            'label' => 'Name',
-	                                            'rules' => 'required|alpha'
-	                                         ),
-	                                    array(
-	                                            'field' => 'title',
-	                                            'label' => 'Title',
-	                                            'rules' => 'required'
-	                                         ),
-	                                    array(
-	                                            'field' => 'message',
-	                                            'label' => 'MessageBody',
-	                                            'rules' => 'required'
-	                                         )
-	                                    )                          
-	               );
+		'signup' => array(
+			array(
+				'field' => 'username',
+				'label' => 'Username',
+				'rules' => 'required'
+			),
+			array(
+				'field' => 'password',
+				'label' => 'Password',
+				'rules' => 'required'
+			),
+			array(
+				'field' => 'passconf',
+				'label' => 'Password Confirmation',
+				'rules' => 'required'
+			),
+			array(
+				'field' => 'email',
+				'label' => 'Email',
+				'rules' => 'required'
+			)
+		),
+		'email' => array(
+			array(
+				'field' => 'emailaddress',
+				'label' => 'EmailAddress',
+				'rules' => 'required|valid_email'
+			),
+			array(
+				'field' => 'name',
+				'label' => 'Name',
+				'rules' => 'required|alpha'
+			),
+			array(
+				'field' => 'title',
+				'label' => 'Title',
+				'rules' => 'required'
+			),
+			array(
+				'field' => 'message',
+				'label' => 'MessageBody',
+				'rules' => 'required'
+			)
+		)
+	);
 
 Calling a Specific Rule Group
 =============================
 
-In order to call a specific group you will pass its name to the ``run()``
+In order to call a specific group, you will pass its name to the ``run()``
 method. For example, to call the signup rule you will do this::
 
 	if ($this->form_validation->run('signup') == FALSE)
@@ -739,8 +732,8 @@
 		$this->load->view('formsuccess');
 	}
 
-Associating a Controller Function with a Rule Group
-===================================================
+Associating a Controller Method with a Rule Group
+=================================================
 
 An alternate (and more automatic) method of calling a rule group is to
 name it according to the controller class/method you intend to use it
@@ -751,7 +744,7 @@
 
 	class Member extends CI_Controller {
 
-		function signup()
+		public function signup()
 		{
 			$this->load->library('form_validation');
 
@@ -770,33 +763,33 @@
 member/signup::
 
 	$config = array(
-	           'member/signup' => array(
-	                                    array(
-	                                            'field' => 'username',
-	                                            'label' => 'Username',
-	                                            'rules' => 'required'
-	                                         ),
-	                                    array(
-	                                            'field' => 'password',
-	                                            'label' => 'Password',
-	                                            'rules' => 'required'
-	                                         ),
-	                                    array(
-	                                            'field' => 'passconf',
-	                                            'label' => 'PasswordConfirmation',
-	                                            'rules' => 'required'
-	                                         ),
-	                                    array(
-	                                            'field' => 'email',
-	                                            'label' => 'Email',
-	                                            'rules' => 'required'
-	                                         )
-	                                    )
-	               );
+		'member/signup' => array(
+			array(
+				'field' => 'username',
+				'label' => 'Username',
+				'rules' => 'required'
+			),
+			array(
+				'field' => 'password',
+				'label' => 'Password',
+				'rules' => 'required'
+			),
+			array(
+				'field' => 'passconf',
+				'label' => 'PasswordConfirmation',
+				'rules' => 'required'
+			),
+			array(
+				'field' => 'email',
+				'label' => 'Email',
+				'rules' => 'required'
+			)
+		)
+	);
 
-When a rule group is named identically to a controller class/function it
-will be used automatically when the run() function is invoked from that
-class/function.
+When a rule group is named identically to a controller class/method it
+will be used automatically when the ``run()`` method is invoked from that
+class/method.
 
 .. _using-arrays-as-field-names:
 
@@ -902,7 +895,7 @@
 **valid_base64**          No         Returns FALSE if the supplied string contains anything other than valid Base64 characters.
 ========================= ========== ============================================================================================= =======================
 
-.. note:: These rules can also be called as discrete functions. For
+.. note:: These rules can also be called as discrete methods. For
 	example::
 
 		$this->form_validation->required($string);
@@ -915,35 +908,35 @@
 Prepping Reference
 ******************
 
-The following is a list of all the prepping functions that are available
+The following is a list of all the prepping methods that are available
 to use:
 
 ==================== ========= ===================================================================================================
 Name                 Parameter Description
 ==================== ========= ===================================================================================================
-**xss_clean**        No        Runs the data through the XSS filtering function, described in the :doc:`Input Class <input>` page.
+**xss_clean**        No        Runs the data through the XSS filtering method, described in the :doc:`Input Class <input>` page.
 **prep_for_form**    No        Converts special characters so that HTML data can be shown in a form field without breaking it.
 **prep_url**         No        Adds "\http://" to URLs if missing.
 **strip_image_tags** No        Strips the HTML from image tags leaving the raw URL.
 **encode_php_tags**  No        Converts PHP tags to entities.
 ==================== ========= ===================================================================================================
 
-.. note:: You can also use any native PHP functions that permit one
-	parameter, like trim, htmlspecialchars, urldecode, etc.
+.. note:: You can also use any native PHP functions that permits one
+	parameter, like ``trim()``, ``htmlspecialchars()``, ``urldecode()``,
+	etc.
 
-.. _function-reference:
+.. _class-reference:
 
-******************
-Function Reference
-******************
+***************
+Class Reference
+***************
 
 .. php:class:: Form_validation
 
-The following functions are intended for use in your controller
-functions.
+The following methods are intended for use in your controller.
 
-$this->form_validation->set_rules();
-====================================
+$this->form_validation->set_rules()
+===================================
 
 	.. php:method:: set_rules ($field, $label = '', $rules = '')
 
@@ -958,8 +951,8 @@
 	-  :ref:`setting-validation-rules`
 	-  :ref:`saving-groups`
 
-$this->form_validation->run();
-==============================
+$this->form_validation->run()
+=============================
 	
 	.. php:method:: run ($group = '')
 
@@ -968,10 +961,10 @@
 
 		Runs the validation routines. Returns boolean TRUE on success and FALSE
 		on failure. You can optionally pass the name of the validation group via
-		the function, as described in: :ref:`saving-groups`
+		the method, as described in: :ref:`saving-groups`
 
-$this->form_validation->set_message();
-======================================
+$this->form_validation->set_message()
+=====================================
 	
 	.. php:method:: set_message ($lang, $val = '')
 
@@ -981,8 +974,8 @@
 
 		Permits you to set custom error messages. See :ref:`setting-error-messages`
 
-$this->form_validation->set_data();
-===================================
+$this->form_validation->set_data()
+==================================
 	
 	.. php:method:: set_data ($data = '')
 
@@ -991,16 +984,16 @@
 		Permits you to set an array for validation, instead of using the default
 		$_POST array.
 
-$this->form_validation->reset_validation();
-===========================================
+$this->form_validation->reset_validation()
+==========================================
 
 	.. php:method:: reset_validation ()
 
 		Permits you to reset the validation when you validate more than one array.
 		This method should be called before validating each new array.
 
-$this->form_validation->error_array();
-======================================
+$this->form_validation->error_array()
+=====================================
 	
 	.. php:method:: error_array ()
 
@@ -1087,5 +1080,5 @@
 
 ::
 
-	<input type="radio" name="myradio" value="1" <?php echo  set_radio('myradio', '1', TRUE); ?> />
-	<input type="radio" name="myradio" value="2" <?php echo  set_radio('myradio', '2'); ?> />
\ No newline at end of file
+	<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
+	<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
\ No newline at end of file