Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 20808)
+++ wp-includes/wp-db.php	(working copy)
@@ -788,7 +788,15 @@
 		if ( $this->dbh && $this->real_escape )
 			return mysql_real_escape_string( $string, $this->dbh );
 		else
-			return addslashes( $string );
+			return strtr( $string, array(
+				"\x00"  => '\x00',
+				"\n"    => '\n',
+				"\r"    => '\r',
+				'\\'    => '\\\\',
+				"'"     => "\'",
+				'"'     => '\"',
+				"\x1a"  => '\x1a'
+			) );
 	}
 
 	/**
