--- xmlrpc.php.orig	2010-06-29 11:10:53.000000000 +0200
+++ xmlrpc.php	2010-06-29 09:53:14.000000000 +0200
@@ -2810,6 +2810,9 @@
 		// Construct the attachment array
 		// attach to post_id 0
 		$post_id = 0;
+		
+		if (!empty($data['post_id'])) $post_id = (int) $data['post_id'];
+		
 		$attachment = array(
 			'post_title' => $name,
 			'post_content' => '',
