Merge branch 'develop' into feature/db_toString_support
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 12cd391..bcff433 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -670,7 +670,7 @@
 	 */
 	public function escape($str)
 	{
-		if (is_string($str))
+		if (is_string($str) OR method_exists($str, '__toString'))
 		{
 			$str = "'".$this->escape_str($str)."'";
 		}