diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index be15252..3d91d2b 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -1462,6 +1462,10 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
 	if ( trim( $link_text ) == '' )
 		$link_text = $_post->post_title;
 
+	// If no title set, fallback to filename
+	if ( trim( $link_text ) == '' )
+		$link_text = basename($_post->guid);
+
 	/**
 	 * Filters a retrieved attachment page link.
 	 *
