Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 23594)
+++ wp-includes/post.php	(working copy)
@@ -2618,6 +2618,7 @@
  *     'guid'          - Global Unique ID for referencing the attachment.
  *     'post_content_filtered' - Post content filtered.
  *     'post_excerpt'  - Post excerpt.
+ *     'slashed'       - Whether the passed data is slashed or not. The default is true.
  *
  * @since 1.0.0
  * @uses $wpdb
@@ -2639,12 +2640,15 @@
 		'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
 		'menu_order' => 0, 'to_ping' =>  '', 'pinged' => '', 'post_password' => '',
 		'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0,
-		'post_content' => '', 'post_title' => '');
+		'post_content' => '', 'post_title' => '', 'slashed' => true );
 
 	$postarr = wp_parse_args($postarr, $defaults);
 
 	unset( $postarr[ 'filter' ] );
 
+	if ( ! $postarr['slashed'] )
+		$postarr = wp_slash( $postarr );
+
 	$postarr = sanitize_post($postarr, 'db');
 
 	// export array as variables
@@ -2905,6 +2909,13 @@
 		// non-escaped post was passed
 		$postarr = get_object_vars($postarr);
 		$postarr = wp_slash($postarr);
+		$postarr['slashed'] = true;
+	} else {
+		if ( ! isset( $postarr['slashed'] ) )
+			$postarr['slashed'] = true;
+
+		if ( ! $postarr['slashed'] )
+			$postarr = wp_slash( $postarr );
 	}
 
 	// First, get all of the original fields
@@ -3858,6 +3869,7 @@
  *     'guid'          - Global Unique ID for referencing the attachment.
  *     'post_content_filtered' - Attachment post content filtered.
  *     'post_excerpt'  - Attachment excerpt.
+ *     'slashed'       - Whether the passed data is slashed or not. The default is true.
  *
  * @since 2.0.0
  * @uses $wpdb
@@ -3876,7 +3888,8 @@
 	$defaults = array('post_status' => 'inherit', 'post_type' => 'post', 'post_author' => $user_ID,
 		'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
 		'menu_order' => 0, 'to_ping' =>  '', 'pinged' => '', 'post_password' => '',
-		'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => '');
+		'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => '',
+		'slashed' => true );
 
 	$object = wp_parse_args($object, $defaults);
 	if ( !empty($parent) )
@@ -3884,6 +3897,9 @@
 
 	unset( $object[ 'filter' ] );
 
+	if ( ! $object['slashed'] )
+		$object = wp_slash( $object );
+
 	$object = sanitize_post($object, 'db');
 
 	// export array as variables
