Index: wp-db.php
===================================================================
--- wp-db.php	(revision 11796)
+++ wp-db.php	(working copy)
@@ -446,6 +446,10 @@
 	}
 
 	function _real_escape($string) {
+		if(is_object($string))
+		{
+			$string = serialize($string); 
+		}
 		if ( $this->dbh && $this->real_escape )
 			return mysql_real_escape_string( $string, $this->dbh );
 		else
