Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 8758)
+++ wp-includes/post.php	(working copy)
@@ -2450,9 +2450,16 @@
 	if ( !$post =& get_post( $post_id ) )
 		return false;
 
-	$url = get_the_guid( $post->ID );
+	$url = '';
+	if ( $file = get_post_meta( $post->ID, '_wp_attached_file', true) ) //Get attached file
+		if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) //Get upload directory
+			if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location
+				$url = str_replace($uploads['basedir'], $uploads['baseurl'], $file); //replace file location with url location
 
-	if ( 'attachment' != $post->post_type || !$url )
+	if ( empty($url) ) //If any of the above options failed, Fallback on the GUID as used pre-2.7, not recomended to rely upon this.
+		$url = get_the_guid( $post->ID );
+
+	if ( 'attachment' != $post->post_type || empty($url) )
 		return false;
 
 	return apply_filters( 'wp_get_attachment_url', $url, $post->ID );
