Index: wp-admin/includes/post.php
===================================================================
--- wp-admin/includes/post.php	(revision 23345)
+++ wp-admin/includes/post.php	(working copy)
@@ -742,8 +742,8 @@
 	if ( !strpos($content, '?attachment_id=') || !preg_match_all( '/<a ([^>]+)>[\s\S]+?<\/a>/', $content, $link_matches ) )
 		return;
 
-	$site_url = get_bloginfo('url');
-	$site_url = substr( $site_url, (int) strpos($site_url, '://') ); // remove the http(s)
+	$home_url = home_url();
+	$home_url = substr( $home_url, (int) strpos( $home_url, '://' ) ); // remove the http(s)
 	$replace = '';
 
 	foreach ( $link_matches[1] as $key => $value ) {
@@ -756,7 +756,7 @@
 		$url_id = (int) $url_match[2];
 		$rel_id = (int) $rel_match[1];
 
-		if ( !$url_id || !$rel_id || $url_id != $rel_id || strpos($url_match[0], $site_url) === false )
+		if ( !$url_id || !$rel_id || $url_id != $rel_id || strpos( $url_match[0], $home_url ) === false )
 			continue;
 
 		$link = $link_matches[0][$key];
