Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php	(revision 17150)
+++ wp-admin/includes/media.php	(working copy)
@@ -444,6 +444,9 @@
 			}
 		}
 
+		if ( isset($attachment['url']) )
+			update_post_meta( $attachment_id, '_wp_attachment_url', esc_url_raw($attachment['url']) );
+
 		if ( isset($post['errors']) ) {
 			$errors[$attachment_id] = $post['errors'];
 			unset($post['errors']);
@@ -907,11 +910,13 @@
 	if ( empty($url_type) )
 		$url_type = get_user_setting('urlbutton', 'post');
 
-	$url = '';
-	if ( $url_type == 'file' )
-		$url = $file;
-	elseif ( $url_type == 'post' )
-		$url = $link;
+	$url = get_post_meta( $post->ID, '_wp_attachment_url', true );
+	if ( empty($url) ) {
+		if ( $url_type == 'file' )
+			$url = $file;
+		elseif ( $url_type == 'post' )
+			$url = $link;
+	}
 
 	return "
 	<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr($url) . "' /><br />
