Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 6350)
+++ wp-includes/post.php	(working copy)
@@ -844,7 +844,7 @@
 
 	if ( empty($tags) )
 		$tags = array();
-	$tags = (is_array($tags)) ? $tags : explode( ',', $tags );
+	$tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \s\n\t\r\0\x0B,") );
 	wp_set_object_terms($post_id, $tags, 'post_tag', $append);
 }
 

