Fixed a bug (#4561) where orhaving() wasn't properly passing values.

Removed some unused variables from the code (#4563).

Fixed a bug where having() was not adding an = into the statement (#4568).
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index dcf9d38..05a0435 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -804,7 +804,7 @@
 

 	function orhaving($key, $value = '', $escape = TRUE)

 	{

-		return $this->or_having($key, $value = '', $escape);

+		return $this->or_having($key, $value, $escape);

 	}	

 	// --------------------------------------------------------------------

 

@@ -852,7 +852,11 @@
 				$k = $this->_protect_identifiers($k);

 			}

 

-			

+			if ( ! $this->_has_operator($k))

+			{

+				$k .= ' = ';

+			}

+

 			if ($v != '')

 			{

 				$v = ' '.$this->escape_str($v);

diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index ab3a248..8eb47dc 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1281,7 +1281,6 @@
 	{

 		$float = $this->bcc_batch_size -1;

 

-		$flag = 0;

 		$set = "";

 

 		$chunk = array();

diff --git a/system/libraries/Router.php b/system/libraries/Router.php
index 6e705f8..c80830f 100644
--- a/system/libraries/Router.php
+++ b/system/libraries/Router.php
@@ -252,7 +252,6 @@
 

 		// Turn the segment array into a URI string

 		$uri = implode('/', $this->uri->segments);

-		$num = count($this->uri->segments);

 

 		// Is there a literal match?  If so we're done

 		if (isset($this->routes[$uri]))

diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 568b3b9..9e39cb4 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -75,7 +75,7 @@
 	<li>Other changes

 		<ul>

 			<li>Added ability to <a href="libraries/input.html">use xss_clean() to test images</a> for XSS, useful for upload security.</li>

-			<li>Improved security in xss_clean().</li>

+			<li>Improved security in <kbd>xss_clean()</kbd>.</li>

 			<li>Considerably expanded list of mobile user-agents in config/user_agents.php.</li>

 		</ul>

 	</li>

@@ -86,11 +86,14 @@
 

 <ul>

 	<li>Amended fixes for bug (#3419) with parsing DSN database connections.</li>

-	<li>Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.</li>

+	<li>Moved the <kbd>_has_operators()</kbd> function (#4535) into DB_driver from DB_active_rec.</li>

 	<li>Fixed a syntax error in upload_lang.php.</li>

 	<li>Fixed a bug (#4542) with a regular expression in the Image library.</li>

+	<li>Fixed a bug (#4561) where <kbd>orhaving()</kbd> wasn't properly passing values.</li>

+	<li>Removed some unused variables from the code (#4563).</li>

+	<li>Fixed a bug where <kbd>having()</kbd> was not adding an = into the statement (#4568).</li>

 	<li>Fixed assorted user guide typos or examples (#4574).</li>

-</ul>

+	</ul>

 

 <h2>Version 1.6.2</h2>

 <p>Release Date: May 13, 2008<br />